diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-08-30 05:35:30 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:58:25 -0500 |
commit | 4db64692e717d10dcd69cc745e8d69a5f4a2be9d (patch) | |
tree | 6cdcd1af52ec40f1232e7736ab88e6025a485e28 /source4/librpc/rpc/dcerpc_tcp.c | |
parent | f3d946646975cc04c5abd6b41adaf547175d6aab (diff) | |
download | samba-4db64692e717d10dcd69cc745e8d69a5f4a2be9d.tar.gz samba-4db64692e717d10dcd69cc745e8d69a5f4a2be9d.tar.bz2 samba-4db64692e717d10dcd69cc745e8d69a5f4a2be9d.zip |
r2103: in the conversion to async rpc I simplified the smb backend to only
use readx/writex instead of the more efficient SMBtrans calls. This
patch restores the efficiency by using SMBtrans when possible.
(This used to be commit 83fbe080e7fcdf4168d85f654b802dc4538b8984)
Diffstat (limited to 'source4/librpc/rpc/dcerpc_tcp.c')
-rw-r--r-- | source4/librpc/rpc/dcerpc_tcp.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/source4/librpc/rpc/dcerpc_tcp.c b/source4/librpc/rpc/dcerpc_tcp.c index 7cf7cc98bb..35928cc1c4 100644 --- a/source4/librpc/rpc/dcerpc_tcp.c +++ b/source4/librpc/rpc/dcerpc_tcp.c @@ -199,10 +199,23 @@ static void tcp_io_handler(struct event_context *ev, struct fd_event *fde, } /* + initiate a read request +*/ +static NTSTATUS tcp_send_read(struct dcerpc_pipe *p) +{ + struct tcp_private *tcp = p->transport.private; + + tcp->recv.pending_count++; + if (tcp->recv.pending_count == 1) { + tcp->fde->flags |= EVENT_FD_READ; + } + return NT_STATUS_OK; +} + +/* send an initial pdu in a multi-pdu sequence */ -static NTSTATUS tcp_send_request(struct dcerpc_pipe *p, - DATA_BLOB *data) +static NTSTATUS tcp_send_request(struct dcerpc_pipe *p, DATA_BLOB *data, BOOL trigger_read) { struct tcp_private *tcp = p->transport.private; struct tcp_blob *blob; @@ -222,20 +235,10 @@ static NTSTATUS tcp_send_request(struct dcerpc_pipe *p, tcp->fde->flags |= EVENT_FD_WRITE; - return NT_STATUS_OK; -} - -/* - initiate a read request -*/ -static NTSTATUS tcp_send_read(struct dcerpc_pipe *p) -{ - struct tcp_private *tcp = p->transport.private; - - tcp->recv.pending_count++; - if (tcp->recv.pending_count == 1) { - tcp->fde->flags |= EVENT_FD_READ; + if (trigger_read) { + tcp_send_read(p); } + return NT_STATUS_OK; } |