} else if ( version != LDAP_VERSION3 ) {
ldap_pvt_thread_mutex_unlock( &upstream->c_io_mutex );
operation_send_reject(
- op, LDAP_PROTOCOL_ERROR, "LDAP version unsupported" );
+ op, LDAP_PROTOCOL_ERROR, "LDAP version unsupported", 1 );
ber_free( copy, 0 );
return 0;
}
Debug( LDAP_DEBUG_STATS, "client_bind: "
"no available connection found\n" );
operation_send_reject(
- op, LDAP_UNAVAILABLE, "no connections available" );
+ op, LDAP_UNAVAILABLE, "no connections available", 1 );
return NULL;
}
fail:
if ( op ) {
- tavl_delete( &c->c_ops, op, operation_client_cmp );
+ operation_send_reject(
+ op, LDAP_OTHER, "server error or overloaded", 1 );
op->o_client = NULL;
operation_destroy( op );
}
}
void
-operation_send_reject( Operation *op, int result, const char *msg )
+operation_send_reject(
+ Operation *op,
+ int result,
+ const char *msg,
+ int send_anyway )
{
Connection *c = op->o_client;
BerElement *ber;
int found;
+ Debug( LDAP_DEBUG_TRACE, "operation_send_reject: "
+ "rejecting %s from client %lu with message: \"%s\"\n",
+ slap_msgtype2str( op->o_tag ), c->c_connid, msg );
+
ldap_pvt_thread_mutex_lock( &c->c_mutex );
found = ( tavl_delete( &c->c_ops, op, operation_client_cmp ) == op );
ldap_pvt_thread_mutex_unlock( &c->c_mutex );
- if ( !found ) {
+ if ( !found && !send_anyway ) {
return;
}
operation_lost_upstream( Operation *op )
{
operation_send_reject( op, LDAP_UNAVAILABLE,
- "connection to the remote server has been severed" );
+ "connection to the remote server has been severed", 0 );
}
void *
if ( upstream ) {
ldap_pvt_thread_mutex_unlock( &upstream->c_io_mutex );
}
- operation_send_reject( op, LDAP_OTHER, "internal error" );
+ operation_send_reject( op, LDAP_OTHER, "internal error", 0 );
return NULL;
}
LDAP_SLAPD_F (int) operation_client_cmp( const void *l, const void *r );
LDAP_SLAPD_F (Operation *) operation_init( Connection *c, BerElement *ber );
LDAP_SLAPD_F (void) operation_abandon( Operation *op );
-LDAP_SLAPD_F (void) operation_send_reject( Operation *op, int result, const char *msg );
+LDAP_SLAPD_F (void) operation_send_reject( Operation *op, int result, const char *msg, int send_anyway );
LDAP_SLAPD_F (void) operation_lost_upstream( Operation *op );
LDAP_SLAPD_F (void) operation_destroy( Operation *op );
LDAP_SLAPD_F (void *) request_process( void *ctx, void *arg );