1
0
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:
Volker Lendecke
2009-05-18 07:08:34 +02:00
parent 795b896ab0
commit f140bf2e65
2 changed files with 4 additions and 4 deletions

View File

@ -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;
}