From 4b6febc670812d688ce6b6edd3fa24e671959b5c Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 28 Aug 2014 11:05:23 +0200 Subject: [PATCH] s4:libcli/composite: correctly finish composite smb and smb2 requests Without this we would hang forever if the connection was already disconnected, instead of directly propagating NT_STATUS_CONNECTION_DISCONNECTED; Signed-off-by: Stefan Metzmacher Reviewed-by: Michael Adam --- source4/libcli/composite/composite.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source4/libcli/composite/composite.c b/source4/libcli/composite/composite.c index 26cf5c80acc..e8ca6e46fc6 100644 --- a/source4/libcli/composite/composite.c +++ b/source4/libcli/composite/composite.c @@ -167,6 +167,10 @@ _PUBLIC_ void composite_continue_smb(struct composite_context *ctx, void *private_data) { if (composite_nomem(new_req, ctx)) return; + if (new_req->state > SMBCLI_REQUEST_RECV) { + composite_error(ctx, new_req->status); + return; + } new_req->async.fn = continuation; new_req->async.private_data = private_data; } @@ -177,6 +181,10 @@ _PUBLIC_ void composite_continue_smb2(struct composite_context *ctx, void *private_data) { if (composite_nomem(new_req, ctx)) return; + if (new_req->state > SMB2_REQUEST_RECV) { + composite_error(ctx, new_req->status); + return; + } new_req->async.fn = continuation; new_req->async.private_data = private_data; }