X-Git-Url: http://git.samba.org/idra/samba.git/?p=idra%2Fsamba.git;a=blobdiff_plain;f=source3%2Flibsmb%2Fasync_smb.c;fp=source3%2Flibsmb%2Fasync_smb.c;h=96b7054b8730d757b6898d5dc7f5a61926fe77eb;hp=7afba0dae991d696b316677d9cfc2073391772fb;hb=aa70e44cd0576e5280e24cf35000369a47dd958f;hpb=2722dd357cedcd3fad1e3739a4a64f924d53eccb diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c index 7afba0dae99..96b7054b873 100644 --- a/source3/libsmb/async_smb.c +++ b/source3/libsmb/async_smb.c @@ -742,6 +742,10 @@ static void cli_smb_sent(struct tevent_req *subreq) nwritten = writev_recv(subreq, &err); TALLOC_FREE(subreq); if (nwritten == -1) { + if (err == EPIPE) { + close(state->cli->fd); + state->cli->fd = -1; + } tevent_req_nterror(req, map_nt_error_from_unix(err)); return; } @@ -787,6 +791,10 @@ 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) { + close(cli->fd); + cli->fd = -1; + } status = map_nt_error_from_unix(err); goto fail; }