Commit b66a6279 authored by Ondřej Kuzník's avatar Ondřej Kuzník
Browse files

ITS#9597 Send Notice of Disconnection when shutting down a client connection

parent 96d0eec0
...@@ -525,7 +525,22 @@ lload_connection_close( LloadConnection *c, void *arg ) ...@@ -525,7 +525,22 @@ lload_connection_close( LloadConnection *c, void *arg )
/* We were approached from the connection list */ /* We were approached from the connection list */
assert( IS_ALIVE( c, c_refcnt ) ); assert( IS_ALIVE( c, c_refcnt ) );
/* Need to acquire this first, even if we won't need it */
checked_lock( &c->c_io_mutex );
CONNECTION_LOCK(c); CONNECTION_LOCK(c);
/* Only if it's a client */
if ( c->c_state == LLOAD_C_OPEN && c->c_destroy == clients_destroy ) {
if ( c->c_pendingber != NULL ||
(c->c_pendingber = ber_alloc()) != NULL ) {
ber_printf( c->c_pendingber, "t{tit{esss}}", LDAP_TAG_MESSAGE,
LDAP_TAG_MSGID, LDAP_RES_UNSOLICITED,
LDAP_RES_EXTENDED, LDAP_UNAVAILABLE, "",
"connection closing", LDAP_NOTICE_OF_DISCONNECTION );
}
}
checked_unlock( &c->c_io_mutex );
if ( !gentle || !c->c_ops ) { if ( !gentle || !c->c_ops ) {
CONNECTION_DESTROY(c); CONNECTION_DESTROY(c);
return LDAP_SUCCESS; return LDAP_SUCCESS;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment