From cdb09105e25affa570d0d6a01bcab358fc9f2294 Mon Sep 17 00:00:00 2001 From: Ira Cooper Date: Thu, 7 Mar 2013 01:06:12 +0000 Subject: [PATCH] s3: Crediting fix to fix a client side Win 7 bug. The client will run itself out of credits, and make mistakes issuing compound requests. This code stops the client from starving itself. Microsoft likely does something similar, they document a "minimum credits" option, defaulted to 64. --- source3/smbd/smb2_server.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c index a0e390e..4631e57 100644 --- a/source3/smbd/smb2_server.c +++ b/source3/smbd/smb2_server.c @@ -486,6 +486,11 @@ static void smb2_set_operation_credit(struct smbd_server_connection *sconn, out_flags = IVAL(outhdr, SMB2_HDR_FLAGS); out_status = NT_STATUS(IVAL(outhdr, SMB2_HDR_STATUS)); + /* This is a wrok around for a Win 7 client bug. */ + if (credits_requested == 0 && sconn->smb2.credits_granted < 64) { + credits_requested = 1; + } + SMB_ASSERT(sconn->smb2.max_credits >= sconn->smb2.credits_granted); if (out_flags & SMB2_HDR_FLAG_ASYNC) { -- 1.7.10.5