summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-08-14 10:06:33 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:29:41 -0500
commitae89ba48ec548f28d38a0a35bc3884181946f1b8 (patch)
tree845559adff7e24b8730e63dc836bb13d5c54e8a3 /source3
parente0880fa7bd79878f53bfa2536e683a38e9c89c6a (diff)
downloadsamba-ae89ba48ec548f28d38a0a35bc3884181946f1b8.tar.gz
samba-ae89ba48ec548f28d38a0a35bc3884181946f1b8.tar.bz2
samba-ae89ba48ec548f28d38a0a35bc3884181946f1b8.zip
r24404: Remove get_OutBuffer usage from blocking.c
(This used to be commit cb8fab5663db2cb408e1b85a7287d3670b09d503)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/blocking.c41
-rw-r--r--source3/smbd/process.c5
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
@@ -250,33 +250,19 @@ BOOL push_blocking_lock_request( struct byte_range_lock *br_lck,
}
/****************************************************************************
- 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.
****************************************************************************/