From daa66ec96c2df1d59fa50c6e8869e4c1bcc2af88 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 25 Sep 2004 11:18:04 +0000 Subject: 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) --- source4/libcli/raw/clitransport.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'source4/libcli/raw') 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; -- cgit