s3: libcli: smb1: Ensure we correctly finish a tevent req if the writev fails in...
authorJeremy Allison <jra@samba.org>
Thu, 19 Mar 2015 17:40:56 +0000 (10:40 -0700)
committerMichael Adam <obnox@samba.org>
Fri, 20 Mar 2015 04:08:25 +0000 (05:08 +0100)
We haven't added the req to the pending array yet, as SMB1 requests can
be one-way (no reply needed). So if we error out after the writev, but
before we add to the pending array we must rember to terminate our current
tevent req with a tevent_req_nterror call.

Fixes bug 11173 - SMB1 Server disconnect can cause timeout on client write error.

https://bugzilla.samba.org/show_bug.cgi?id=11173

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Mar 20 05:08:25 CET 2015 on sn-devel-104

libcli/smb/smbXcli_base.c

index 5773ab3d18c871fcf45ff9dc46aa0267e34b12d7..9f73566c7e46d425ac09a5279a195cdba0c201b5 100644 (file)
@@ -1613,6 +1613,7 @@ static void smb1cli_req_writev_done(struct tevent_req *subreq)
        if (nwritten == -1) {
                NTSTATUS status = map_nt_error_from_unix_common(err);
                smbXcli_conn_disconnect(state->conn, status);
+               tevent_req_nterror(req, status);
                return;
        }