summaryrefslogtreecommitdiff
path: root/source3/smbd/ipc.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2002-01-20 02:40:05 +0000
committerAndrew Bartlett <abartlet@samba.org>2002-01-20 02:40:05 +0000
commitbb6af711b8f9a525b74198abbe7f1c37014ca6f7 (patch)
treebd27852105178310652be36d293282b0abd1de7d /source3/smbd/ipc.c
parent93a8358910d2b8788ffea33c04244ffd5ffecabf (diff)
downloadsamba-bb6af711b8f9a525b74198abbe7f1c37014ca6f7.tar.gz
samba-bb6af711b8f9a525b74198abbe7f1c37014ca6f7.tar.bz2
samba-bb6af711b8f9a525b74198abbe7f1c37014ca6f7.zip
This is the current patch from Luke Leighton <lckl@samba-tng.org> to add a
degree of seperation betwen reading/writing the raw NamedPipe SMB packets and the matching operations inside smbd's RPC components. This patch is designed for no change in behaviour, and my tests hold that to be true. This patch does however allow for the future loadable modules interface to specify function pointers in replacement of the fixed state. The pipes_struct has been split into two peices, with smb_np_struct taking the information that should be generic to where the data ends up. Some other minor changes are made: we get another small helper function in util_sock.c and some of the original code has better failure debugs and variable use. (As per on-list comments). Andrew Bartlett (This used to be commit 8ef13cabdddf58b741886782297fb64b2fb7e489)
Diffstat (limited to 'source3/smbd/ipc.c')
-rw-r--r--source3/smbd/ipc.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c
index 4047ffa8d7..f84f3048e9 100644
--- a/source3/smbd/ipc.c
+++ b/source3/smbd/ipc.c
@@ -163,8 +163,9 @@ void send_trans_reply(char *outbuf,
Start the first part of an RPC reply which began with an SMBtrans request.
****************************************************************************/
-static BOOL api_rpc_trans_reply(char *outbuf, pipes_struct *p)
+static BOOL api_rpc_trans_reply(char *outbuf, smb_np_struct *p)
{
+ BOOL is_data_outstanding;
char *rdata = malloc(p->max_trans_reply);
int data_len;
@@ -173,12 +174,13 @@ static BOOL api_rpc_trans_reply(char *outbuf, pipes_struct *p)
return False;
}
- if((data_len = read_from_pipe( p, rdata, p->max_trans_reply)) < 0) {
+ if((data_len = read_from_pipe( p, rdata, p->max_trans_reply,
+ &is_data_outstanding)) < 0) {
SAFE_FREE(rdata);
return False;
}
- send_trans_reply(outbuf, NULL, 0, rdata, data_len, p->out_data.current_pdu_len > data_len);
+ send_trans_reply(outbuf, NULL, 0, rdata, data_len, is_data_outstanding);
SAFE_FREE(rdata);
return True;
@@ -188,7 +190,7 @@ static BOOL api_rpc_trans_reply(char *outbuf, pipes_struct *p)
WaitNamedPipeHandleState
****************************************************************************/
-static BOOL api_WNPHS(char *outbuf, pipes_struct *p, char *param, int param_len)
+static BOOL api_WNPHS(char *outbuf, smb_np_struct *p, char *param, int param_len)
{
uint16 priority;
@@ -211,7 +213,7 @@ static BOOL api_WNPHS(char *outbuf, pipes_struct *p, char *param, int param_len)
SetNamedPipeHandleState
****************************************************************************/
-static BOOL api_SNPHS(char *outbuf, pipes_struct *p, char *param, int param_len)
+static BOOL api_SNPHS(char *outbuf, smb_np_struct *p, char *param, int param_len)
{
uint16 id;
@@ -259,7 +261,7 @@ static int api_fd_reply(connection_struct *conn,uint16 vuid,char *outbuf,
int suwcnt,int tdscnt,int tpscnt,int mdrcnt,int mprcnt)
{
BOOL reply = False;
- pipes_struct *p = NULL;
+ smb_np_struct *p = NULL;
int pnum;
int subcommand;