mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-23 16:19:35 -05:00
Fix connection teardown
This commit is contained in:
parent
7aeac21440
commit
e8d7074802
1 changed files with 7 additions and 5 deletions
|
|
@ -657,6 +657,7 @@ connection_destroy( Connection *c )
|
||||||
unsigned long connid;
|
unsigned long connid;
|
||||||
const char *close_reason;
|
const char *close_reason;
|
||||||
Sockbuf *sb;
|
Sockbuf *sb;
|
||||||
|
ber_socket_t sd;
|
||||||
|
|
||||||
assert( connections != NULL );
|
assert( connections != NULL );
|
||||||
assert( c != NULL );
|
assert( c != NULL );
|
||||||
|
|
@ -719,6 +720,8 @@ connection_destroy( Connection *c )
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
sd = c->c_sd;
|
||||||
|
c->c_sd = AC_SOCKET_INVALID;
|
||||||
c->c_conn_state = SLAP_C_INVALID;
|
c->c_conn_state = SLAP_C_INVALID;
|
||||||
c->c_struct_state = SLAP_C_UNUSED;
|
c->c_struct_state = SLAP_C_UNUSED;
|
||||||
c->c_close_reason = "?"; /* should never be needed */
|
c->c_close_reason = "?"; /* should never be needed */
|
||||||
|
|
@ -733,17 +736,16 @@ connection_destroy( Connection *c )
|
||||||
/* c must be fully reset by this point; when we call slapd_remove
|
/* c must be fully reset by this point; when we call slapd_remove
|
||||||
* it may get immediately reused by a new connection.
|
* it may get immediately reused by a new connection.
|
||||||
*/
|
*/
|
||||||
if ( c->c_sd != AC_SOCKET_INVALID ) {
|
if ( sd != AC_SOCKET_INVALID ) {
|
||||||
slapd_remove( c->c_sd, sb, 1, 0, 0 );
|
slapd_remove( sd, sb, 1, 0, 0 );
|
||||||
|
|
||||||
if ( close_reason == NULL ) {
|
if ( close_reason == NULL ) {
|
||||||
Statslog( LDAP_DEBUG_STATS, "conn=%lu fd=%ld closed\n",
|
Statslog( LDAP_DEBUG_STATS, "conn=%lu fd=%ld closed\n",
|
||||||
connid, (long) c->c_sd, 0, 0, 0 );
|
connid, (long) sd, 0, 0, 0 );
|
||||||
} else {
|
} else {
|
||||||
Statslog( LDAP_DEBUG_STATS, "conn=%lu fd=%ld closed (%s)\n",
|
Statslog( LDAP_DEBUG_STATS, "conn=%lu fd=%ld closed (%s)\n",
|
||||||
connid, (long) c->c_sd, close_reason, 0, 0 );
|
connid, (long) sd, close_reason, 0, 0 );
|
||||||
}
|
}
|
||||||
c->c_sd = AC_SOCKET_INVALID;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue