From: Jeremy Allison Date: Thu, 12 Mar 2020 18:01:05 +0000 (-0700) Subject: s3: smbd: Remove old synchronous SMB1 reply_exit(). X-Git-Tag: ldb-2.2.0~1426 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1de0daa715f3324e3620ae8152b7fbaeb40ee9d9;p=thirdparty%2Fsamba.git 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 Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index a2cc9e104ad..be7c170cd1f 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -5766,21 +5766,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; }; @@ -5979,7 +5991,6 @@ static void reply_exit_done(struct tevent_req *req) END_PROFILE(SMBexit); return; } -#endif struct reply_close_state { files_struct *fsp;