X-Git-Url: http://git.samba.org/?p=samba.git;a=blobdiff_plain;f=libcli%2Fsmb%2Ftstream_smbXcli_np.c;h=8dfc4fb2466a1ad1b1879c9a92d64c1a37c93b50;hp=af0863e50bb65593450cdca095a6fa7c2e3e3157;hb=78c3533729c99527e07813170f70bed1a3c836b2;hpb=3bbd8d3614af641535ab0925303ad07c03c4e094 diff --git a/libcli/smb/tstream_smbXcli_np.c b/libcli/smb/tstream_smbXcli_np.c index af0863e50bb..8dfc4fb2466 100644 --- a/libcli/smb/tstream_smbXcli_np.c +++ b/libcli/smb/tstream_smbXcli_np.c @@ -111,7 +111,11 @@ static int tstream_smbXcli_np_destructor(struct tstream_smbXcli_np *cli_nps) * Once we've fixed all callers to call * tstream_disconnect_send()/_recv(), this will * never be called. + * + * We use a maximun timeout of 1 second == 1000 msec. */ + cli_nps->timeout = MIN(cli_nps->timeout, 1000); + if (cli_nps->is_smb1) { status = smb1cli_close(cli_nps->conn, cli_nps->timeout, @@ -1006,7 +1010,7 @@ static void tstream_smbXcli_np_readv_trans_done(struct tevent_req *subreq) cli_nps->read.buf = talloc_array(cli_nps, uint8_t, received); if (cli_nps->read.buf == NULL) { TALLOC_FREE(subreq); - tevent_req_nomem(cli_nps->read.buf, req); + tevent_req_oom(req); return; } memcpy(cli_nps->read.buf, rcvbuf, received); @@ -1092,7 +1096,7 @@ static void tstream_smbXcli_np_readv_read_done(struct tevent_req *subreq) cli_nps->read.buf = talloc_array(cli_nps, uint8_t, received); if (cli_nps->read.buf == NULL) { TALLOC_FREE(subreq); - tevent_req_nomem(cli_nps->read.buf, req); + tevent_req_oom(req); return; } memcpy(cli_nps->read.buf, rcvbuf, received);