diff options
author | Jeremy Allison <jra@samba.org> | 2020-03-12 11:01:05 -0700 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2020-04-07 08:12:36 +0000 |
commit | 824bc7f7f5b8ce13e82a79d75b2550e239f60445 (patch) | |
tree | 13f9c41635a1ce9dc9a40e5fc24a364bba74b3db | |
parent | 2b32fdde6929bcac49e9168a64c47a6bb31cd67b (diff) | |
download | samba-824bc7f7f5b8ce13e82a79d75b2550e239f60445.tar.gz |
s3: smbd: Remove old synchronous SMB1 reply_exit().
SMB1 exit is now fully async.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 1de0daa715f3324e3620ae8152b7fbaeb40ee9d9)
-rw-r--r-- | source3/smbd/reply.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 944c31b7807..54f3d330c95 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -5760,21 +5760,33 @@ void reply_flush(struct smb_request *req) conn POINTER CAN BE NULL HERE ! ****************************************************************************/ -void reply_exit(struct smb_request *req) -{ - START_PROFILE(SMBexit); - - file_close_pid(req->sconn, req->smbpid, req->vuid); +static struct tevent_req *reply_exit_send(struct smb_request *smb1req); +static void reply_exit_done(struct tevent_req *req); - reply_outbuf(req, 0, 0); +void reply_exit(struct smb_request *smb1req) +{ + struct tevent_req *req; - DEBUG(3,("exit\n")); + /* + * Don't setup the profile charge here, take + * it in reply_exit_done(). Not strictly correct + * but better than the other SMB1 async + * code that double-charges at the moment. + */ + req = reply_exit_send(smb1req); + if (req == NULL) { + /* Not going async, profile here. */ + START_PROFILE(SMBexit); + reply_force_doserror(smb1req, ERRDOS, ERRnomem); + END_PROFILE(SMBexit); + return; + } - END_PROFILE(SMBexit); + /* We're async. This will complete later. */ + tevent_req_set_callback(req, reply_exit_done, smb1req); return; } -#if 0 struct reply_exit_state { struct tevent_queue *wait_queue; }; @@ -5973,7 +5985,6 @@ static void reply_exit_done(struct tevent_req *req) END_PROFILE(SMBexit); return; } -#endif struct reply_close_state { files_struct *fsp; |