]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Remove old synchronous SMB1 reply_exit().
authorJeremy Allison <jra@samba.org>
Thu, 12 Mar 2020 18:01:05 +0000 (11:01 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 18 Mar 2020 18:03:29 +0000 (18:03 +0000)
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>
source3/smbd/reply.c

index a2cc9e104ad53a00903f0fb9d758929f2630f65a..be7c170cd1f4142290eef3a7f1278829decb27b0 100644 (file)
@@ -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;