libcli: Add error log if insufficient SMB2 credits
authorTim Beale <timbeale@catalyst.net.nz>
Sun, 6 Jan 2019 23:06:15 +0000 (12:06 +1300)
committerKarolin Seeger <kseeger@samba.org>
Fri, 1 Feb 2019 10:34:10 +0000 (11:34 +0100)
Although it's unusual to hit this case, I was seeing it happen while
working on the SMB python bindings. Even with debug level 10, there was
nothing coming out to help pin down the source of the
NT_STATUS_INTERNAL_ERROR.

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

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit bf229de7926f12e329cdb3201f68f20ae776fe32)

libcli/smb/smbXcli_base.c

index 40480c83aa05b62949b93bae543342f5716880d5..a237bf17d0a68b2f5966bff39ca73c94e408b599 100644 (file)
@@ -3231,6 +3231,9 @@ NTSTATUS smb2cli_req_compound_submit(struct tevent_req **reqs,
 
                avail = MIN(avail, state->conn->smb2.cur_credits);
                if (avail < charge) {
+                       DBG_ERR("Insufficient credits. "
+                               "%"PRIu64" available, %"PRIu16" needed\n",
+                               avail, charge);
                        return NT_STATUS_INTERNAL_ERROR;
                }