diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-09-05 09:31:54 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-09-05 18:01:06 +0200 |
commit | 0b6087c7be01983be96f3f3cb892ba2f32a8266a (patch) | |
tree | d12870bb08b514165642a737b067712cf035910d | |
parent | 5155a15c5cadd2dec9386576c1b4b566be1e4536 (diff) | |
download | samba-0b6087c7be01983be96f3f3cb892ba2f32a8266a.tar.gz samba-0b6087c7be01983be96f3f3cb892ba2f32a8266a.tar.bz2 samba-0b6087c7be01983be96f3f3cb892ba2f32a8266a.zip |
s3:smb2cli: disconnect the connection, if we're out of message ids
metze
-rw-r--r-- | source3/libsmb/smb2cli_base.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/source3/libsmb/smb2cli_base.c b/source3/libsmb/smb2cli_base.c index a25183e19b..e59d9a5d48 100644 --- a/source3/libsmb/smb2cli_base.c +++ b/source3/libsmb/smb2cli_base.c @@ -256,6 +256,10 @@ NTSTATUS smb2cli_req_compound_submit(struct tevent_req **reqs, state = tevent_req_data(reqs[i], struct smb2cli_req_state); + if (state->cli->smb2.mid == UINT64_MAX) { + return NT_STATUS_CONNECTION_ABORTED; + } + mid = state->cli->smb2.mid; state->cli->smb2.mid += 1; @@ -580,7 +584,17 @@ static void smb2cli_inbuf_received(struct tevent_req *subreq) num_pending = talloc_array_length(cli->conn.pending); if (num_pending == 0) { - /* no more pending requests, so we are done for now */ + if (state->cli->smb2.mid < UINT64_MAX) { + /* no more pending requests, so we are done for now */ + return; + } + + /* + * If there are no more requests possible, + * because we are out of message ids, + * we need to disconnect. + */ + smb2cli_notify_pending(cli, NT_STATUS_CONNECTION_ABORTED); return; } req = cli->conn.pending[0]; |