From: Julio Sánchez Fernández Date: Tue, 20 Jul 1999 18:02:44 +0000 (+0000) Subject: Move the input data exhaustion loop to connection.c from daemon.c X-Git-Tag: OPENLDAP_REL_ENG_2_BP~81 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=76227acb1f80cb08cec385bfbddebd09b80bd627;p=openldap 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. --- 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;