From 0b6087c7be01983be96f3f3cb892ba2f32a8266a Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 5 Sep 2011 09:31:54 +0200 Subject: s3:smb2cli: disconnect the connection, if we're out of message ids metze --- source3/libsmb/smb2cli_base.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'source3') 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]; -- cgit