From: Howard Chu Date: Thu, 15 Jan 2004 20:20:17 +0000 (+0000) Subject: ITS#2921, fix client connection handling for HAVE_WINSOCK X-Git-Tag: OPENLDAP_REL_ENG_2_1_MP~29 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=bb1a97544d05f9479d785354690d9cb9bee823e7;p=openldap ITS#2921, fix client connection handling for HAVE_WINSOCK --- diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index 55bff400b9..ce61d3c30d 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -321,7 +321,6 @@ static Connection* connection_get( ber_socket_t s ) ldap_pvt_thread_mutex_unlock( &c->c_mutex ); return NULL; } - if( c->c_conn_state == SLAP_C_CLIENT ) sd = 0; #ifdef NEW_LOGGING LDAP_LOG( CONNECTION, RESULTS, @@ -424,6 +423,10 @@ long connection_init( break; } + if( connections[i].c_conn_state == SLAP_C_CLIENT ) { + continue; + } + assert( connections[i].c_struct_state == SLAP_C_USED ); assert( connections[i].c_conn_state != SLAP_C_INVALID ); assert( sd != AC_SOCKET_INVALID ); @@ -528,6 +531,7 @@ long connection_init( if ( flags == CONN_IS_CLIENT ) { c->c_conn_state = SLAP_C_CLIENT; c->c_struct_state = SLAP_C_USED; + ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_SET_FD, &s ); ldap_pvt_thread_mutex_unlock( &c->c_mutex ); ldap_pvt_thread_mutex_unlock( &connections_mutex );