mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-29 10:07:32 -05:00
Remove check for inactive streams before connection_read/_write
calls. Such checks are ineffective it protecting connection_read/_write from being called inactive streams. connection_read/_write have their own protection against such (in connection_get()).
This commit is contained in:
parent
87b86a52e4
commit
e2e1cb76cb
1 changed files with 12 additions and 21 deletions
|
|
@ -553,17 +553,12 @@ slapd_daemon_task(
|
||||||
"daemon: write active on %d\n",
|
"daemon: write active on %d\n",
|
||||||
wd, 0, 0 );
|
wd, 0, 0 );
|
||||||
|
|
||||||
ldap_pvt_thread_mutex_lock( &slap_daemon.sd_mutex );
|
/*
|
||||||
active = FD_ISSET( wd, &slap_daemon.sd_actives );
|
* NOTE: it is possible that the connection was closed
|
||||||
ldap_pvt_thread_mutex_unlock( &slap_daemon.sd_mutex );
|
* and that the stream is now inactive.
|
||||||
|
* connection_write() must valid the stream is still
|
||||||
if( ! active ) {
|
* active.
|
||||||
/* descriptor no longer in FD set, should be closed */
|
*/
|
||||||
Debug( LDAP_DEBUG_CONNS,
|
|
||||||
"daemon: write %d inactive, closing.\n", wd, 0, 0 );
|
|
||||||
slapd_close( wd );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( connection_write( wd ) < 0 ) {
|
if ( connection_write( wd ) < 0 ) {
|
||||||
FD_CLR( (unsigned) wd, &readfds );
|
FD_CLR( (unsigned) wd, &readfds );
|
||||||
|
|
@ -595,17 +590,13 @@ slapd_daemon_task(
|
||||||
Debug ( LDAP_DEBUG_CONNS,
|
Debug ( LDAP_DEBUG_CONNS,
|
||||||
"daemon: read activity on %d\n", rd, 0, 0 );
|
"daemon: read activity on %d\n", rd, 0, 0 );
|
||||||
|
|
||||||
ldap_pvt_thread_mutex_lock( &slap_daemon.sd_mutex );
|
|
||||||
active = FD_ISSET( rd, &slap_daemon.sd_actives );
|
|
||||||
ldap_pvt_thread_mutex_unlock( &slap_daemon.sd_mutex );
|
|
||||||
|
|
||||||
if( ! active ) {
|
/*
|
||||||
/* descriptor no longer in FD set, should be closed */
|
* NOTE: it is possible that the connection was closed
|
||||||
Debug( LDAP_DEBUG_CONNS,
|
* and that the stream is now inactive.
|
||||||
"daemon: read %d inactive, closing.\n", rd, 0, 0 );
|
* connection_read() must valid the stream is still
|
||||||
slapd_close( rd );
|
* active.
|
||||||
continue;
|
*/
|
||||||
}
|
|
||||||
|
|
||||||
if ( connection_read( rd ) < 0 ) {
|
if ( connection_read( rd ) < 0 ) {
|
||||||
slapd_close( rd );
|
slapd_close( rd );
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue