c = connection_get( s );
c->c_clientfunc = func;
c->c_clientarg = arg;
- connection_return( c );
+
slapd_add_internal( s, 0 );
slapd_set_read( s, 1 );
+ connection_return( c );
return 0;
}
ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_SET_MAX_INCOMING, &max );
}
- connection_return( c );
slapd_remove( s, 0, 1 );
+ connection_return( c );
}
#ifdef SLAP_LIGHTWEIGHT_DISPATCHER
Debug( LDAP_DEBUG_TRACE,
"connection_read(%d): closing, ignoring input for id=%lu\n",
s, c->c_connid, 0 );
- connection_return( c );
- ldap_pvt_thread_mutex_unlock( MCA_GET_CONN_MUTEX(s) );
#ifdef SLAP_LIGHTWEIGHT_DISPATCHER
- slapd_set_read( s, 1);
+ slapd_set_read( s, 1 );
#endif
+ connection_return( c );
+ ldap_pvt_thread_mutex_unlock( MCA_GET_CONN_MUTEX(s) );
return 0;
}
rc = ldap_pvt_tls_accept( c->c_sb, slap_tls_ctx );
if ( rc < 0 ) {
Debug( LDAP_DEBUG_TRACE,
- "connection_read(%d): TLS accept error "
+ "connection_read(%d): TLS accept failure "
"error=%d id=%lu, closing\n",
s, rc, c->c_connid );
#endif
connection_close( c );
+ connection_return( c );
+ ldap_pvt_thread_mutex_unlock( MCA_GET_CONN_MUTEX(s) );
+ return 0;
} else if ( rc == 0 ) {
void *ssl;
if( rc != 0 ||
!ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_DATA_READY, NULL ) )
{
- connection_return( c );
- ldap_pvt_thread_mutex_unlock( MCA_GET_CONN_MUTEX(s) );
-
#ifdef SLAP_LIGHTWEIGHT_DISPATCHER
slapd_set_read( s, 1 );
#endif
+
+ connection_return( c );
+ ldap_pvt_thread_mutex_unlock( MCA_GET_CONN_MUTEX(s) );
return 0;
}
}
if ( c->c_sasl_layers ) {
/* If previous layer is not removed yet, give up for now */
if ( !c->c_sasl_sockctx ) {
- connection_return( c );
- ldap_pvt_thread_mutex_unlock( MCA_GET_CONN_MUTEX(s) );
-
#ifdef SLAP_LIGHTWEIGHT_DISPATCHER
slapd_set_read( s, 1 );
#endif
+
+ connection_return( c );
+ ldap_pvt_thread_mutex_unlock( MCA_GET_CONN_MUTEX(s) );
return 0;
}
s, rc, c->c_connid );
/* connections_mutex and c_mutex are locked */
-
-#ifdef SLAP_LIGHTWEIGHT_DISPATCHER
- slapd_set_read( s, 1 );
-#endif
-
connection_closing( c, "SASL layer install failure" );
connection_close( c );
connection_return( c );
break;
}
- connection_return( c );
+ connection_return( c );
ldap_pvt_thread_mutex_unlock( MCA_GET_CONN_MUTEX(s) );
-
return 0;
}