From 0053b27ce0b457a553c2640c58265131b6bea0fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julio=20S=C3=A1nchez=20Fern=C3=A1ndez?= Date: Fri, 16 Jul 1999 18:53:30 +0000 Subject: [PATCH] Look on connection_read() if it returns positive so it has a chance to exhaust all protocol units received from the transport layer. I think this is the necessary fix for the TLS-data-ready/ socket-not-ready issue, but I have not experimented that problem yet, so I am unsure about its effectiveness. Now, do we need something like that for connection_write? How would we go about implementing it? --- servers/slapd/daemon.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index ee09d97731..4f8b3c7a37 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -689,6 +689,7 @@ slapd_daemon_task( { ber_socket_t rd; int is_listener = 0; + int rc; #ifdef HAVE_WINSOCK rd = readfds.fd_array[i]; @@ -719,7 +720,9 @@ slapd_daemon_task( * active. */ - if ( connection_read( rd ) < 0 ) { + while ( ( rc = connection_read( rd ) ) > 0 ) + ; + if ( rc < 0 ) { slapd_close( rd ); } }