Author: vlendec
Date: 2007-08-14 10:06:33 +0000 (Tue, 14 Aug 2007)
New Revision: 24404

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=24404

Log:
Remove get_OutBuffer usage from blocking.c

Modified:
   branches/SAMBA_3_2/source/smbd/blocking.c
   branches/SAMBA_3_2/source/smbd/process.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/blocking.c
===================================================================
--- branches/SAMBA_3_2/source/smbd/blocking.c   2007-08-14 08:44:00 UTC (rev 
24403)
+++ branches/SAMBA_3_2/source/smbd/blocking.c   2007-08-14 10:06:33 UTC (rev 
24404)
@@ -250,34 +250,20 @@
 }
 
 /****************************************************************************
- Return a smd with a given size.
-*****************************************************************************/
-
-static void send_blocking_reply(char *outbuf, int outsize, const char *inbuf)
-{
-       if(outsize > 4) {
-               smb_setlen(inbuf, outbuf,outsize - 4);
-       }
-
-       if (!send_smb(smbd_server_fd(),outbuf)) {
-               exit_server_cleanly("send_blocking_reply: send_smb failed.");
-       }
-}
-
-/****************************************************************************
  Return a lockingX success SMB.
 *****************************************************************************/
 
 static void reply_lockingX_success(blocking_lock_record *blr)
 {
-       char *outbuf = get_OutBuffer();
-       int bufsize = BUFFER_SIZE;
-       char *inbuf = blr->inbuf;
-       int outsize = 0;
+       struct smb_request *req;
 
-       construct_reply_common(inbuf, outbuf);
-       set_message(inbuf,outbuf,2,0,True);
+       if (!(req = talloc(tmp_talloc_ctx(), struct smb_request))) {
+               smb_panic("Could not allocate smb_request");
+       }
 
+       init_smb_request(req, (uint8 *)blr->inbuf);
+       reply_outbuf(req, 2, 0);
+
        /*
         * As this message is a lockingX call we must handle
         * any following chained message correctly.
@@ -286,11 +272,11 @@
         * that here and must set up the chain info manually.
         */
 
-       outsize = chain_reply(inbuf,&outbuf,blr->length,bufsize);
+       chain_reply_new(req);
 
-       outsize += chain_size;
-
-       send_blocking_reply(outbuf,outsize,inbuf);
+       if (!send_smb(smbd_server_fd(),(char *)req->outbuf)) {
+               exit_server_cleanly("send_blocking_reply: send_smb failed.");
+       }
 }
 
 /****************************************************************************
@@ -299,8 +285,9 @@
 
 static void generic_blocking_lock_error(blocking_lock_record *blr, NTSTATUS 
status)
 {
-       char *outbuf = get_OutBuffer();
+       char outbuf[smb_size];
        char *inbuf = blr->inbuf;
+
        construct_reply_common(inbuf, outbuf);
 
        /* whenever a timeout is given w2k maps LOCK_NOT_GRANTED to
@@ -395,7 +382,7 @@
        case SMBtrans2:
        case SMBtranss2:
                {
-                       char *outbuf = get_OutBuffer();
+                       char outbuf[smb_size];
                        char *inbuf = blr->inbuf;
                        construct_reply_common(inbuf, outbuf);
                        /* construct_reply_common has done us the favor to 
pre-fill the

Modified: branches/SAMBA_3_2/source/smbd/process.c
===================================================================
--- branches/SAMBA_3_2/source/smbd/process.c    2007-08-14 08:44:00 UTC (rev 
24403)
+++ branches/SAMBA_3_2/source/smbd/process.c    2007-08-14 10:06:33 UTC (rev 
24404)
@@ -1743,11 +1743,6 @@
        return InBuffer;
 }
 
-char *get_OutBuffer(void)
-{
-       return OutBuffer;
-}
-
 /****************************************************************************
  Allocate a new InBuffer. Returns the new and old ones.
 ****************************************************************************/

Reply via email to