mirror of
https://github.com/samba-team/samba.git
synced 2025-08-04 08:22:08 +03:00
Fix broken pipe handling
Metze is right: If we have *any* error at the socket level, we just can not continue. Also, apply some defensive programming: With this async stuff someone else might already have closed the socket.
This commit is contained in:
@ -742,7 +742,7 @@ static void cli_smb_sent(struct tevent_req *subreq)
|
||||
nwritten = writev_recv(subreq, &err);
|
||||
TALLOC_FREE(subreq);
|
||||
if (nwritten == -1) {
|
||||
if (err == EPIPE) {
|
||||
if (state->cli->fd != -1) {
|
||||
close(state->cli->fd);
|
||||
state->cli->fd = -1;
|
||||
}
|
||||
@ -791,7 +791,7 @@ static void cli_smb_received(struct tevent_req *subreq)
|
||||
received = read_smb_recv(subreq, talloc_tos(), &inbuf, &err);
|
||||
TALLOC_FREE(subreq);
|
||||
if (received == -1) {
|
||||
if (err == EPIPE) {
|
||||
if (cli->fd != -1) {
|
||||
close(cli->fd);
|
||||
cli->fd = -1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user