From: Howard Chu Date: Sat, 29 Oct 2005 15:16:35 +0000 (+0000) Subject: ITS#4108 fix another accept/read race condition X-Git-Tag: OPENLDAP_REL_ENG_2_2_MP~171 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e131aa424b2b9945c771c68228e8acacf7462eb4;p=openldap ITS#4108 fix another accept/read race condition --- diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index e8773c0fe2..385186f882 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -751,6 +751,7 @@ long connection_init( slap_sasl_open( c, 0 ); slap_sasl_external( c, ssf, authid ); + slapd_add_internal( s, 1 ); ldap_pvt_thread_mutex_unlock( &c->c_mutex ); ldap_pvt_thread_mutex_unlock( MCA_GET_CONN_MUTEX(s) ); @@ -1393,13 +1394,13 @@ void connection_client_stop( c->c_close_reason = "?"; /* should never be needed */ slapd_sd_lock(); ber_sockbuf_free( c->c_sb ); + slapd_remove( s, 0, 1, 1 ); c->c_sb = ber_sockbuf_alloc( ); { ber_len_t max = sockbuf_max_incoming; ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_SET_MAX_INCOMING, &max ); } - slapd_remove( s, 0, 1, 1 ); connection_return( c ); } @@ -1447,7 +1448,7 @@ int connection_read_activate( ber_socket_t s ) if( rc != 0 ) { Debug( LDAP_DEBUG_ANY, - "connection_read_activiate(%d): submit failed (%d)\n", + "connection_read_activate(%d): submit failed (%d)\n", s, rc, 0 ); } diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index 408d9aaeb3..4adc2345ed 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -1516,7 +1516,6 @@ slap_listener( id, (long) s, peername, sl->sl_name.bv_val, 0 ); - slapd_add( s, 1, NULL ); return 0; }