From ae89ba48ec548f28d38a0a35bc3884181946f1b8 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 14 Aug 2007 10:06:33 +0000 Subject: r24404: Remove get_OutBuffer usage from blocking.c (This used to be commit cb8fab5663db2cb408e1b85a7287d3670b09d503) --- source3/smbd/blocking.c | 41 ++++++++++++++--------------------------- source3/smbd/process.c | 5 ----- 2 files changed, 14 insertions(+), 32 deletions(-) diff --git a/source3/smbd/blocking.c b/source3/smbd/blocking.c index 0b24fc8257..8bdc992910 100644 --- a/source3/smbd/blocking.c +++ b/source3/smbd/blocking.c @@ -249,34 +249,20 @@ BOOL push_blocking_lock_request( struct byte_range_lock *br_lck, return True; } -/**************************************************************************** - 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 @@ -286,11 +272,11 @@ static void reply_lockingX_success(blocking_lock_record *blr) * that here and must set up the chain info manually. */ - outsize = chain_reply(inbuf,&outbuf,blr->length,bufsize); - - outsize += chain_size; + chain_reply_new(req); - 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 reply_lockingX_success(blocking_lock_record *blr) 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 @@ static void blocking_lock_reply_error(blocking_lock_record *blr, NTSTATUS status 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 diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 7e499b7797..ca55c8f63f 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -1743,11 +1743,6 @@ char *get_InBuffer(void) return InBuffer; } -char *get_OutBuffer(void) -{ - return OutBuffer; -} - /**************************************************************************** Allocate a new InBuffer. Returns the new and old ones. ****************************************************************************/ -- cgit