summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-09-25 11:18:04 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:59:13 -0500
commitdaa66ec96c2df1d59fa50c6e8869e4c1bcc2af88 (patch)
tree92762c67f0acf8dc9ef2285b2014282a3cdbaea7 /source4/libcli
parent368802bc867f544355b5a8c4bc5e4b6ab47dd408 (diff)
downloadsamba-daa66ec96c2df1d59fa50c6e8869e4c1bcc2af88.tar.gz
samba-daa66ec96c2df1d59fa50c6e8869e4c1bcc2af88.tar.bz2
samba-daa66ec96c2df1d59fa50c6e8869e4c1bcc2af88.zip
r2624: - save some system calls by only trying read/write operations that select has indicated are possible
- when a socket is dead, don't try to do anything more on it (This used to be commit e95e5c591fcf9c3b7fde7fbdcc1837e22195e0a8)
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/raw/clitransport.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source4/libcli/raw/clitransport.c b/source4/libcli/raw/clitransport.c
index 2d29ba371f..85d5337da7 100644
--- a/source4/libcli/raw/clitransport.c
+++ b/source4/libcli/raw/clitransport.c
@@ -21,6 +21,10 @@
#include "includes.h"
+
+static void smbcli_transport_process_recv(struct smbcli_transport *transport);
+static void smbcli_transport_process_send(struct smbcli_transport *transport);
+
/*
an event has happened on the socket
*/
@@ -29,7 +33,12 @@ static void smbcli_transport_event_handler(struct event_context *ev, struct fd_e
{
struct smbcli_transport *transport = fde->private;
- smbcli_transport_process(transport);
+ if (flags & EVENT_FD_READ) {
+ smbcli_transport_process_recv(transport);
+ }
+ if (flags & EVENT_FD_WRITE) {
+ smbcli_transport_process_send(transport);
+ }
}
/*
@@ -265,6 +274,7 @@ static void smbcli_transport_process_send(struct smbcli_transport *transport)
return;
}
smbcli_transport_dead(transport);
+ return;
}
req->out.buffer += ret;
req->out.size -= ret;