From 5146c9ba9df063d6611abe356f9262adb027b091 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 8 Jun 2011 16:11:00 +0200 Subject: s3:libsmb/clitrans: move MID handling to the end of cli_trans_send() and add a comment metze --- source3/libsmb/clitrans.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'source3/libsmb/clitrans.c') diff --git a/source3/libsmb/clitrans.c b/source3/libsmb/clitrans.c index cf6809b4c0..82a73ee2c0 100644 --- a/source3/libsmb/clitrans.c +++ b/source3/libsmb/clitrans.c @@ -441,14 +441,23 @@ struct tevent_req *cli_trans_send( if (tevent_req_nomem(subreq, req)) { return tevent_req_post(req, ev); } - state->mid = cli_smb_req_mid(subreq); status = cli_smb_req_send(subreq); if (!NT_STATUS_IS_OK(status)) { tevent_req_nterror(req, status); return tevent_req_post(req, state->ev); } - cli_state_seqnum_persistent(cli, state->mid); tevent_req_set_callback(subreq, cli_trans_done, req); + + /* + * Now get the MID of the primary request + * and mark it as persistent. This means + * we will able to send and receive multiple + * SMB pdus using this MID in both directions + * (including correct SMB signing). + */ + state->mid = cli_smb_req_mid(subreq); + cli_state_seqnum_persistent(cli, state->mid); + return req; } -- cgit