From 76227acb1f80cb08cec385bfbddebd09b80bd627 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Julio=20S=C3=A1nchez=20Fern=C3=A1ndez?= Date: Tue, 20 Jul 1999 18:02:44 +0000 Subject: [PATCH] Move the input data exhaustion loop to connection.c from daemon.c Let transport (TLS or somesuch) force reading or writing on sockets even if the higher layers think otherwise. --- servers/slapd/connection.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index 27c7fda824..a1e4a05811 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -817,9 +817,9 @@ int connection_read(ber_socket_t s) #define CONNECTION_INPUT_LOOP 1 #ifdef DATA_READY_LOOP - while(!rc && ber_pvt_sb_data_ready(&c->c_sb)) + while(rc >= 0 && ber_pvt_sb_data_ready(&c->c_sb)) #elif CONNECTION_INPUT_LOOP - while(!rc) + while(rc >= 0) #endif { rc = connection_input( c ); @@ -835,6 +835,10 @@ int connection_read(ber_socket_t s) connection_close( c ); } + if ( ber_pvt_sb_needs_read( c->c_sb ) ) + slapd_set_read( s, 1 ); + if ( ber_pvt_sb_needs_write( c->c_sb ) ) + slapd_set_write( s, 1 ); connection_return( c ); ldap_pvt_thread_mutex_unlock( &connections_mutex ); return 0; @@ -1054,6 +1058,10 @@ int connection_write(ber_socket_t s) ldap_pvt_thread_cond_signal( &c->c_write_cv ); + if ( ber_pvt_sb_needs_read( c->c_sb ) ) + slapd_set_read( s, 1 ); + if ( ber_pvt_sb_needs_write( c->c_sb ) ) + slapd_set_write( s, 1 ); connection_return( c ); ldap_pvt_thread_mutex_unlock( &connections_mutex ); return 0; -- 2.39.5