From a25936f1b1300a76b08a6bd435bd7ccc388279d5 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 8 Jun 2011 10:20:25 +0200 Subject: s3:libsmb/async_smb: don't remove pending requests if the mid is set If the mid was set explicitly, it means the request expects more than one reply, so leave it in the pending array. metze --- source3/libsmb/async_smb.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c index 2e0ddb9fdb..c09a886f5e 100644 --- a/source3/libsmb/async_smb.c +++ b/source3/libsmb/async_smb.c @@ -153,6 +153,14 @@ void cli_smb_req_unset_pending(struct tevent_req *req) int num_pending = talloc_array_length(cli->pending); int i; + if (state->mid != 0) { + /* + * This is a [nt]trans[2] request which waits + * for more than one reply. + */ + return; + } + if (num_pending == 1) { /* * The pending read_smb tevent_req is a child of @@ -193,6 +201,13 @@ void cli_smb_req_unset_pending(struct tevent_req *req) static int cli_smb_req_destructor(struct tevent_req *req) { + struct cli_smb_state *state = tevent_req_data( + req, struct cli_smb_state); + /* + * Make sure we really remove it from + * the pending array on destruction. + */ + state->mid = 0; cli_smb_req_unset_pending(req); return 0; } -- cgit