Add construct_reply_common_req wrapper
authorVolker Lendecke <vl@samba.org>
Mon, 3 Nov 2008 19:16:09 +0000 (20:16 +0100)
committerVolker Lendecke <vl@samba.org>
Tue, 4 Nov 2008 19:52:06 +0000 (20:52 +0100)
The goal is to remove the remaining direct calls to construct_reply_common.

source3/include/proto.h
source3/smbd/aio.c
source3/smbd/process.c
source3/smbd/reply.c

index 0d4404b339ce8394842b83d3738e483de2813f13..be811dfd70c478a56c5d51cefe0ea28a5996de47 100644 (file)
@@ -8232,6 +8232,7 @@ const char *smb_fn_name(int type);
 void add_to_common_flags2(uint32 v);
 void remove_from_common_flags2(uint32 v);
 void construct_reply_common(const char *inbuf, char *outbuf);
+void construct_reply_common_req(struct smb_request *req, char *outbuf);
 void chain_reply(struct smb_request *req);
 void check_reload(time_t t);
 void smbd_process(void);
index b59b37277176da0593e59bba5adfa6f004be7189..7e27c27b5a06e1c0e1ba5f8a40775b7b9bfd7d43 100644 (file)
@@ -250,7 +250,7 @@ bool schedule_aio_read_and_X(connection_struct *conn,
                return False;
        }
 
-       construct_reply_common((char *)req->inbuf, aio_ex->outbuf);
+       construct_reply_common_req(req, aio_ex->outbuf);
        srv_set_message(aio_ex->outbuf, 12, 0, True);
        SCVAL(aio_ex->outbuf,smb_vwv0,0xFF); /* Never a chained reply. */
 
index bd0acbc3c61465620ac9e8e0039c3bbc9412b05d..1dcfb4b12273e767fde2f6e6060152f6bf64a184 100644 (file)
@@ -1608,6 +1608,11 @@ void construct_reply_common(const char *inbuf, char *outbuf)
        SSVAL(outbuf,smb_mid,SVAL(inbuf,smb_mid));
 }
 
+void construct_reply_common_req(struct smb_request *req, char *outbuf)
+{
+       return construct_reply_common((char *)req->inbuf, outbuf);
+}
+
 /****************************************************************************
  Construct a chained reply and add it to the already made reply
 ****************************************************************************/
index 7b5ed8feb451b224653dd70a23b66a9b24a4b78e..377ba4e530e33883d1d14235b2c5aac6a2904fa0 100644 (file)
@@ -3129,7 +3129,7 @@ static void send_file_readX(connection_struct *conn, struct smb_request *req,
 
                header = data_blob_const(headerbuf, sizeof(headerbuf));
 
-               construct_reply_common((char *)req->inbuf, (char *)headerbuf);
+               construct_reply_common_req(req, (char *)headerbuf);
                setup_readX_header((char *)headerbuf, smb_maxcnt);
 
                if ((nread = SMB_VFS_SENDFILE(smbd_server_fd(), fsp, &header, startpos, smb_maxcnt)) == -1) {
@@ -3181,7 +3181,7 @@ normal_read:
        if ((smb_maxcnt & 0xFF0000) > 0x10000) {
                uint8 headerbuf[smb_size + 2*12];
 
-               construct_reply_common((char *)req->inbuf, (char *)headerbuf);
+               construct_reply_common_req(req, (char *)headerbuf);
                setup_readX_header((char *)headerbuf, smb_maxcnt);
 
                /* Send out the header. */