s3:smbd: let construct_reply() also use smb_request_done()
authorStefan Metzmacher <metze@samba.org>
Wed, 11 Jun 2014 06:34:05 +0000 (08:34 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 6 Aug 2014 07:51:12 +0000 (09:51 +0200)
This way it matches the code path in construct_reply_chain().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
source3/smbd/process.c

index c0157332f51e65f22fadda3909c3420cc1c259db..c1685da3f5f301df4a38b24f4f4445458d6ee6a5 100644 (file)
@@ -1644,7 +1644,6 @@ static void construct_reply(struct smbd_server_connection *sconn,
                            struct smb_perfcount_data *deferred_pcd)
 {
        struct smbXsrv_connection *xconn = sconn->conn;
-       connection_struct *conn;
        struct smb_request *req;
 
        if (!(req = talloc(talloc_tos(), struct smb_request))) {
@@ -1667,27 +1666,19 @@ static void construct_reply(struct smbd_server_connection *sconn,
                SMB_PERFCOUNT_SET_MSGLEN_IN(&req->pcd, size);
        }
 
-       conn = switch_message(req->cmd, req);
+       req->conn = switch_message(req->cmd, req);
 
        if (req->outbuf == NULL) {
+               /*
+                * Request has suspended itself, will come
+                * back here.
+                */
                return;
        }
-
        if (CVAL(req->outbuf,0) == 0) {
                show_msg((char *)req->outbuf);
        }
-
-       if (!srv_send_smb(req->sconn,
-                       (char *)req->outbuf,
-                       true, req->seqnum+1,
-                       IS_CONN_ENCRYPTED(conn)||req->encrypted,
-                       &req->pcd)) {
-               exit_server_cleanly("construct_reply: srv_send_smb failed.");
-       }
-
-       TALLOC_FREE(req);
-
-       return;
+       smb_request_done(req);
 }
 
 static void construct_reply_chain(struct smbd_server_connection *sconn,