diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-06-08 10:20:25 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2011-06-10 19:27:05 +0200 |
commit | a25936f1b1300a76b08a6bd435bd7ccc388279d5 (patch) | |
tree | f0b2cb187e2e7e1fd775d397351ea85430753ba3 /source3 | |
parent | 173fc258e443d97e4ea37f2bee99c21ad15ab484 (diff) | |
download | samba-a25936f1b1300a76b08a6bd435bd7ccc388279d5.tar.gz samba-a25936f1b1300a76b08a6bd435bd7ccc388279d5.tar.bz2 samba-a25936f1b1300a76b08a6bd435bd7ccc388279d5.zip |
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
Diffstat (limited to 'source3')
-rw-r--r-- | source3/libsmb/async_smb.c | 15 |
1 files changed, 15 insertions, 0 deletions
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; } |