mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-30 03:29:35 -05:00
Rename macros and symbols to lloadd
This commit is contained in:
parent
11f474385a
commit
b801ca17cb
9 changed files with 98 additions and 97 deletions
|
|
@ -215,7 +215,7 @@ backend_select( Operation *op )
|
|||
LDAP_CIRCLEQ_FOREACH ( c, head, c_next ) {
|
||||
ldap_pvt_thread_mutex_lock( &c->c_io_mutex );
|
||||
CONNECTION_LOCK(c);
|
||||
if ( c->c_state == SLAP_C_READY && !c->c_pendingber &&
|
||||
if ( c->c_state == LLOAD_C_READY && !c->c_pendingber &&
|
||||
( b->b_max_conn_pending == 0 ||
|
||||
c->c_n_ops_executing < b->b_max_conn_pending ) ) {
|
||||
Debug( LDAP_DEBUG_CONNS, "backend_select: "
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ request_bind( Operation *op )
|
|||
avl_dup_error ) ) {
|
||||
assert(0);
|
||||
}
|
||||
upstream->c_state = SLAP_C_ACTIVE;
|
||||
upstream->c_state = LLOAD_C_ACTIVE;
|
||||
CONNECTION_UNLOCK(upstream);
|
||||
|
||||
ldap_pvt_thread_mutex_unlock( &upstream->c_io_mutex );
|
||||
|
|
@ -313,8 +313,8 @@ client_bind( Connection *client, Operation *op )
|
|||
|
||||
client_reset( client );
|
||||
|
||||
client->c_state = SLAP_C_BINDING;
|
||||
client->c_type = SLAP_C_OPEN;
|
||||
client->c_state = LLOAD_C_BINDING;
|
||||
client->c_type = LLOAD_C_OPEN;
|
||||
|
||||
rc = tavl_insert( &client->c_ops, op, operation_client_cmp, avl_dup_error );
|
||||
assert( rc == LDAP_SUCCESS );
|
||||
|
|
@ -358,9 +358,9 @@ client_bind( Connection *client, Operation *op )
|
|||
|
||||
if ( !--op->o_client_refcnt ) {
|
||||
operation_destroy_from_client( op );
|
||||
if ( client->c_state == SLAP_C_BINDING ) {
|
||||
client->c_state = SLAP_C_READY;
|
||||
client->c_type = SLAP_C_OPEN;
|
||||
if ( client->c_state == LLOAD_C_BINDING ) {
|
||||
client->c_state = LLOAD_C_READY;
|
||||
client->c_type = LLOAD_C_OPEN;
|
||||
if ( !BER_BVISNULL( &client->c_auth ) ) {
|
||||
ber_memfree( client->c_auth.bv_val );
|
||||
BER_BVZERO( &client->c_auth );
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ handle_one_request( Connection *c )
|
|||
handler = request_extended;
|
||||
break;
|
||||
default:
|
||||
if ( c->c_state == SLAP_C_BINDING ) {
|
||||
if ( c->c_state == LLOAD_C_BINDING ) {
|
||||
return operation_send_reject_locked(
|
||||
op, LDAP_PROTOCOL_ERROR, "bind in progress", 0 );
|
||||
}
|
||||
|
|
@ -104,7 +104,7 @@ client_init(
|
|||
ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_SET_MAX_INCOMING, &max );
|
||||
}
|
||||
|
||||
c->c_state = SLAP_C_READY;
|
||||
c->c_state = LLOAD_C_READY;
|
||||
|
||||
event = event_new( base, s, EV_READ|EV_PERSIST, read_cb, c );
|
||||
if ( !event ) {
|
||||
|
|
@ -147,7 +147,7 @@ fail:
|
|||
c->c_read_event = NULL;
|
||||
}
|
||||
|
||||
c->c_state = SLAP_C_INVALID;
|
||||
c->c_state = LLOAD_C_INVALID;
|
||||
CONNECTION_DESTROY(c);
|
||||
assert( c == NULL );
|
||||
return NULL;
|
||||
|
|
@ -163,9 +163,9 @@ client_destroy( Connection *c )
|
|||
"destroying client connid=%lu\n",
|
||||
c->c_connid );
|
||||
|
||||
assert( c->c_state != SLAP_C_INVALID );
|
||||
assert( c->c_state != LLOAD_C_INVALID );
|
||||
state = c->c_state;
|
||||
c->c_state = SLAP_C_INVALID;
|
||||
c->c_state = LLOAD_C_INVALID;
|
||||
|
||||
read_event = c->c_read_event;
|
||||
write_event = c->c_write_event;
|
||||
|
|
@ -190,7 +190,7 @@ client_destroy( Connection *c )
|
|||
event_del( write_event );
|
||||
}
|
||||
|
||||
if ( state != SLAP_C_CLOSING ) {
|
||||
if ( state != LLOAD_C_CLOSING ) {
|
||||
ldap_pvt_thread_mutex_lock( &clients_mutex );
|
||||
LDAP_CIRCLEQ_REMOVE( &clients, c, c_next );
|
||||
ldap_pvt_thread_mutex_unlock( &clients_mutex );
|
||||
|
|
@ -217,7 +217,7 @@ client_destroy( Connection *c )
|
|||
*/
|
||||
assert( c->c_refcnt >= 0 );
|
||||
if ( c->c_refcnt ) {
|
||||
c->c_state = SLAP_C_CLOSING;
|
||||
c->c_state = LLOAD_C_CLOSING;
|
||||
Debug( LDAP_DEBUG_CONNS, "client_destroy: "
|
||||
"connid=%lu aborting with refcnt=%d\n",
|
||||
c->c_connid, c->c_refcnt );
|
||||
|
|
|
|||
|
|
@ -71,10 +71,10 @@ static char *logfileName;
|
|||
|
||||
lload_features_t lload_features;
|
||||
|
||||
ber_len_t sockbuf_max_incoming_client = SLAP_SB_MAX_INCOMING_CLIENT;
|
||||
ber_len_t sockbuf_max_incoming_upstream = SLAP_SB_MAX_INCOMING_UPSTREAM;
|
||||
ber_len_t sockbuf_max_incoming_client = LLOAD_SB_MAX_INCOMING_CLIENT;
|
||||
ber_len_t sockbuf_max_incoming_upstream = LLOAD_SB_MAX_INCOMING_UPSTREAM;
|
||||
|
||||
int slap_conn_max_pdus_per_cycle = SLAP_CONN_MAX_PDUS_PER_CYCLE_DEFAULT;
|
||||
int slap_conn_max_pdus_per_cycle = LLOAD_CONN_MAX_PDUS_PER_CYCLE_DEFAULT;
|
||||
|
||||
int slap_write_timeout = 10000;
|
||||
|
||||
|
|
|
|||
|
|
@ -289,7 +289,7 @@ connection_destroy( Connection *c )
|
|||
|
||||
assert( c->c_live == 0 );
|
||||
assert( c->c_refcnt == 0 );
|
||||
assert( c->c_state == SLAP_C_INVALID );
|
||||
assert( c->c_state == LLOAD_C_INVALID );
|
||||
|
||||
ber_sockbuf_free( c->c_sb );
|
||||
|
||||
|
|
@ -394,7 +394,7 @@ connection_init( ber_socket_t s, const char *peername, int flags )
|
|||
c->c_connid, s, peername );
|
||||
|
||||
CONNECTION_LOCK(c);
|
||||
c->c_state = SLAP_C_ACTIVE;
|
||||
c->c_state = LLOAD_C_ACTIVE;
|
||||
|
||||
return c;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ request_extended( Connection *c, Operation *op )
|
|||
}
|
||||
ber_free( copy, 0 );
|
||||
|
||||
if ( c->c_state == SLAP_C_BINDING ) {
|
||||
if ( c->c_state == LLOAD_C_BINDING ) {
|
||||
return operation_send_reject_locked(
|
||||
op, LDAP_PROTOCOL_ERROR, "bind in progress", 0 );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -165,9 +165,9 @@ operation_destroy_from_client( Operation *op )
|
|||
* others */
|
||||
ldap_pvt_thread_mutex_lock( &op->o_mutex );
|
||||
race_state = op->o_freeing;
|
||||
op->o_freeing |= SLAP_OP_FREEING_CLIENT;
|
||||
op->o_freeing |= LLOAD_OP_FREEING_CLIENT;
|
||||
if ( detach_client ) {
|
||||
op->o_freeing |= SLAP_OP_DETACHING_CLIENT;
|
||||
op->o_freeing |= LLOAD_OP_DETACHING_CLIENT;
|
||||
}
|
||||
ldap_pvt_thread_mutex_unlock( &op->o_mutex );
|
||||
|
||||
|
|
@ -192,8 +192,8 @@ operation_destroy_from_client( Operation *op )
|
|||
"op=%p lost race but client connid=%lu is going down\n",
|
||||
op, client->c_connid );
|
||||
CONNECTION_LOCK_DECREF(client);
|
||||
} else if ( (race_state & SLAP_OP_FREEING_MASK) ==
|
||||
SLAP_OP_FREEING_UPSTREAM ) {
|
||||
} else if ( (race_state & LLOAD_OP_FREEING_MASK) ==
|
||||
LLOAD_OP_FREEING_UPSTREAM ) {
|
||||
Debug( LDAP_DEBUG_TRACE, "operation_destroy_from_client: "
|
||||
"op=%p lost race, increased client refcnt connid=%lu "
|
||||
"to refcnt=%d\n",
|
||||
|
|
@ -212,7 +212,7 @@ operation_destroy_from_client( Operation *op )
|
|||
|
||||
/* 5. If we raced the upstream side and won, reclaim the token */
|
||||
ldap_pvt_thread_mutex_lock( &op->o_link_mutex );
|
||||
if ( !(race_state & SLAP_OP_DETACHING_UPSTREAM) ) {
|
||||
if ( !(race_state & LLOAD_OP_DETACHING_UPSTREAM) ) {
|
||||
upstream = op->o_upstream;
|
||||
if ( upstream ) {
|
||||
CONNECTION_LOCK(upstream);
|
||||
|
|
@ -223,8 +223,8 @@ operation_destroy_from_client( Operation *op )
|
|||
ldap_pvt_thread_mutex_lock( &op->o_mutex );
|
||||
/* We don't actually resolve the race in full until we grab the other's
|
||||
* c_mutex+op->o_mutex here */
|
||||
if ( upstream && ( op->o_freeing & SLAP_OP_FREEING_UPSTREAM ) ) {
|
||||
if ( op->o_freeing & SLAP_OP_DETACHING_UPSTREAM ) {
|
||||
if ( upstream && ( op->o_freeing & LLOAD_OP_FREEING_UPSTREAM ) ) {
|
||||
if ( op->o_freeing & LLOAD_OP_DETACHING_UPSTREAM ) {
|
||||
CONNECTION_UNLOCK(upstream);
|
||||
upstream = NULL;
|
||||
} else {
|
||||
|
|
@ -251,9 +251,9 @@ operation_destroy_from_client( Operation *op )
|
|||
|
||||
/* There must have been no race if op is still alive */
|
||||
ldap_pvt_thread_mutex_lock( &op->o_mutex );
|
||||
op->o_freeing &= ~SLAP_OP_FREEING_CLIENT;
|
||||
op->o_freeing &= ~LLOAD_OP_FREEING_CLIENT;
|
||||
if ( detach_client ) {
|
||||
op->o_freeing &= ~SLAP_OP_DETACHING_CLIENT;
|
||||
op->o_freeing &= ~LLOAD_OP_DETACHING_CLIENT;
|
||||
}
|
||||
assert( op->o_freeing == 0 );
|
||||
ldap_pvt_thread_mutex_unlock( &op->o_mutex );
|
||||
|
|
@ -326,9 +326,9 @@ operation_destroy_from_upstream( Operation *op )
|
|||
|
||||
ldap_pvt_thread_mutex_lock( &op->o_mutex );
|
||||
race_state = op->o_freeing;
|
||||
op->o_freeing |= SLAP_OP_FREEING_UPSTREAM;
|
||||
op->o_freeing |= LLOAD_OP_FREEING_UPSTREAM;
|
||||
if ( detach_upstream ) {
|
||||
op->o_freeing |= SLAP_OP_DETACHING_UPSTREAM;
|
||||
op->o_freeing |= LLOAD_OP_DETACHING_UPSTREAM;
|
||||
}
|
||||
ldap_pvt_thread_mutex_unlock( &op->o_mutex );
|
||||
|
||||
|
|
@ -360,8 +360,8 @@ operation_destroy_from_upstream( Operation *op )
|
|||
"op=%p lost race but upstream connid=%lu is going down\n",
|
||||
op, upstream->c_connid );
|
||||
CONNECTION_LOCK_DECREF(upstream);
|
||||
} else if ( (race_state & SLAP_OP_FREEING_MASK) ==
|
||||
SLAP_OP_FREEING_CLIENT ) {
|
||||
} else if ( (race_state & LLOAD_OP_FREEING_MASK) ==
|
||||
LLOAD_OP_FREEING_CLIENT ) {
|
||||
Debug( LDAP_DEBUG_TRACE, "operation_destroy_from_upstream: "
|
||||
"op=%p lost race, increased upstream refcnt connid=%lu "
|
||||
"to refcnt=%d\n",
|
||||
|
|
@ -380,7 +380,7 @@ operation_destroy_from_upstream( Operation *op )
|
|||
|
||||
/* 5. If we raced the client side and won, reclaim the token */
|
||||
ldap_pvt_thread_mutex_lock( &op->o_link_mutex );
|
||||
if ( !(race_state & SLAP_OP_DETACHING_CLIENT) ) {
|
||||
if ( !(race_state & LLOAD_OP_DETACHING_CLIENT) ) {
|
||||
client = op->o_client;
|
||||
if ( client ) {
|
||||
CONNECTION_LOCK(client);
|
||||
|
|
@ -391,8 +391,8 @@ operation_destroy_from_upstream( Operation *op )
|
|||
/* We don't actually resolve the race in full until we grab the other's
|
||||
* c_mutex+op->o_mutex here */
|
||||
ldap_pvt_thread_mutex_lock( &op->o_mutex );
|
||||
if ( client && ( op->o_freeing & SLAP_OP_FREEING_CLIENT ) ) {
|
||||
if ( op->o_freeing & SLAP_OP_DETACHING_CLIENT ) {
|
||||
if ( client && ( op->o_freeing & LLOAD_OP_FREEING_CLIENT ) ) {
|
||||
if ( op->o_freeing & LLOAD_OP_DETACHING_CLIENT ) {
|
||||
CONNECTION_UNLOCK(client);
|
||||
client = NULL;
|
||||
} else {
|
||||
|
|
@ -418,9 +418,9 @@ operation_destroy_from_upstream( Operation *op )
|
|||
op, op->o_client_refcnt );
|
||||
/* There must have been no race if op is still alive */
|
||||
ldap_pvt_thread_mutex_lock( &op->o_mutex );
|
||||
op->o_freeing &= ~SLAP_OP_FREEING_UPSTREAM;
|
||||
op->o_freeing &= ~LLOAD_OP_FREEING_UPSTREAM;
|
||||
if ( detach_upstream ) {
|
||||
op->o_freeing &= ~SLAP_OP_DETACHING_UPSTREAM;
|
||||
op->o_freeing &= ~LLOAD_OP_DETACHING_UPSTREAM;
|
||||
}
|
||||
assert( op->o_freeing == 0 );
|
||||
ldap_pvt_thread_mutex_unlock( &op->o_mutex );
|
||||
|
|
@ -544,8 +544,8 @@ operation_abandon( Operation *op )
|
|||
/* The operation has already been abandoned or finished */
|
||||
goto unlock;
|
||||
}
|
||||
if ( c->c_state == SLAP_C_BINDING ) {
|
||||
c->c_state = SLAP_C_READY;
|
||||
if ( c->c_state == LLOAD_C_BINDING ) {
|
||||
c->c_state = LLOAD_C_READY;
|
||||
}
|
||||
c->c_n_ops_executing--;
|
||||
b = (Backend *)c->c_private;
|
||||
|
|
@ -601,8 +601,8 @@ done:
|
|||
|
||||
/* Caller should hold a reference on client */
|
||||
CONNECTION_LOCK(c);
|
||||
if ( c->c_state == SLAP_C_BINDING ) {
|
||||
c->c_state = SLAP_C_READY;
|
||||
if ( c->c_state == LLOAD_C_BINDING ) {
|
||||
c->c_state = LLOAD_C_READY;
|
||||
}
|
||||
op->o_client_refcnt--;
|
||||
operation_destroy_from_client( op );
|
||||
|
|
@ -647,11 +647,11 @@ request_abandon( Connection *c, Operation *op )
|
|||
c->c_connid, op->o_client_msgid, slap_msgtype2str( request->o_tag ),
|
||||
needle.o_client_msgid );
|
||||
|
||||
if ( c->c_state == SLAP_C_BINDING ) {
|
||||
if ( c->c_state == LLOAD_C_BINDING ) {
|
||||
/* We have found the request and we are binding, it must be a bind
|
||||
* request */
|
||||
assert( request->o_tag == LDAP_REQ_BIND );
|
||||
c->c_state = SLAP_C_READY;
|
||||
c->c_state = LLOAD_C_READY;
|
||||
}
|
||||
|
||||
CONNECTION_UNLOCK_INCREF(c);
|
||||
|
|
@ -826,7 +826,7 @@ request_process( Connection *client, Operation *op )
|
|||
assert( rc == LDAP_SUCCESS );
|
||||
|
||||
if ( (lload_features & LLOAD_FEATURE_PROXYAUTHZ) &&
|
||||
client->c_type != SLAP_C_PRIVILEGED ) {
|
||||
client->c_type != LLOAD_C_PRIVILEGED ) {
|
||||
CONNECTION_LOCK_DECREF(client);
|
||||
Debug( LDAP_DEBUG_TRACE, "request_process: "
|
||||
"proxying identity %s to upstream\n",
|
||||
|
|
|
|||
|
|
@ -78,16 +78,16 @@ LDAP_BEGIN_DECL
|
|||
#define SLAP_STRDUP(s) ber_strdup( ( s ) )
|
||||
#define SLAP_STRNDUP(s, l) ber_strndup( ( s ), ( l ) )
|
||||
|
||||
#define SERVICE_NAME OPENLDAP_PACKAGE "-slapd"
|
||||
#define SERVICE_NAME OPENLDAP_PACKAGE "-lloadd"
|
||||
#define SLAPD_ANONYMOUS ""
|
||||
#define SLAP_STRING_UNKNOWN "unknown"
|
||||
|
||||
#define SLAP_MAX_WORKER_THREADS ( 16 )
|
||||
|
||||
#define SLAP_SB_MAX_INCOMING_CLIENT ( ( 1 << 18 ) - 1 )
|
||||
#define SLAP_SB_MAX_INCOMING_UPSTREAM ( ( 1 << 24 ) - 1 )
|
||||
#define LLOAD_SB_MAX_INCOMING_CLIENT ( ( 1 << 18 ) - 1 )
|
||||
#define LLOAD_SB_MAX_INCOMING_UPSTREAM ( ( 1 << 24 ) - 1 )
|
||||
|
||||
#define SLAP_CONN_MAX_PDUS_PER_CYCLE_DEFAULT 10
|
||||
#define LLOAD_CONN_MAX_PDUS_PER_CYCLE_DEFAULT 10
|
||||
|
||||
#define SLAP_TEXT_BUFLEN ( 256 )
|
||||
|
||||
|
|
@ -292,17 +292,17 @@ typedef void (*CONNECTION_DESTROY_CB)( Connection *c );
|
|||
|
||||
/* connection state (protected by c_mutex) */
|
||||
enum sc_state {
|
||||
SLAP_C_INVALID = 0, /* MUST BE ZERO (0) */
|
||||
SLAP_C_READY, /* ready */
|
||||
SLAP_C_CLOSING, /* closing */
|
||||
SLAP_C_ACTIVE, /* exclusive operation (tls setup, ...) in progress */
|
||||
SLAP_C_BINDING, /* binding */
|
||||
LLOAD_C_INVALID = 0, /* MUST BE ZERO (0) */
|
||||
LLOAD_C_READY, /* ready */
|
||||
LLOAD_C_CLOSING, /* closing */
|
||||
LLOAD_C_ACTIVE, /* exclusive operation (tls setup, ...) in progress */
|
||||
LLOAD_C_BINDING, /* binding */
|
||||
};
|
||||
enum sc_type {
|
||||
SLAP_C_OPEN = 0, /* regular connection */
|
||||
SLAP_C_PREPARING, /* upstream connection not assigned yet */
|
||||
SLAP_C_BIND, /* connection used to handle bind client requests if VC not enabled */
|
||||
SLAP_C_PRIVILEGED, /* connection can override proxyauthz control */
|
||||
LLOAD_C_OPEN = 0, /* regular connection */
|
||||
LLOAD_C_PREPARING, /* upstream connection not assigned yet */
|
||||
LLOAD_C_BIND, /* connection used to handle bind client requests if VC not enabled */
|
||||
LLOAD_C_PRIVILEGED, /* connection can override proxyauthz control */
|
||||
};
|
||||
/*
|
||||
* represents a connection from an ldap client/to ldap server
|
||||
|
|
@ -422,16 +422,16 @@ struct Connection {
|
|||
};
|
||||
|
||||
enum op_state {
|
||||
SLAP_OP_NOT_FREEING = 0,
|
||||
SLAP_OP_FREEING_UPSTREAM = 1 << 0,
|
||||
SLAP_OP_FREEING_CLIENT = 1 << 1,
|
||||
SLAP_OP_DETACHING_UPSTREAM = 1 << 2,
|
||||
SLAP_OP_DETACHING_CLIENT = 1 << 3,
|
||||
LLOAD_OP_NOT_FREEING = 0,
|
||||
LLOAD_OP_FREEING_UPSTREAM = 1 << 0,
|
||||
LLOAD_OP_FREEING_CLIENT = 1 << 1,
|
||||
LLOAD_OP_DETACHING_UPSTREAM = 1 << 2,
|
||||
LLOAD_OP_DETACHING_CLIENT = 1 << 3,
|
||||
};
|
||||
#define SLAP_OP_FREEING_MASK \
|
||||
( SLAP_OP_FREEING_UPSTREAM | SLAP_OP_FREEING_CLIENT )
|
||||
#define SLAP_OP_DETACHING_MASK \
|
||||
( SLAP_OP_DETACHING_UPSTREAM | SLAP_OP_DETACHING_CLIENT )
|
||||
#define LLOAD_OP_FREEING_MASK \
|
||||
( LLOAD_OP_FREEING_UPSTREAM | LLOAD_OP_FREEING_CLIENT )
|
||||
#define LLOAD_OP_DETACHING_MASK \
|
||||
( LLOAD_OP_DETACHING_UPSTREAM | LLOAD_OP_DETACHING_CLIENT )
|
||||
|
||||
struct Operation {
|
||||
Connection *o_client;
|
||||
|
|
|
|||
|
|
@ -118,25 +118,25 @@ handle_bind_response( Operation *op, BerElement *ber )
|
|||
|
||||
CONNECTION_LOCK(upstream);
|
||||
if ( result != LDAP_SASL_BIND_IN_PROGRESS ) {
|
||||
upstream->c_state = SLAP_C_READY;
|
||||
upstream->c_state = LLOAD_C_READY;
|
||||
}
|
||||
CONNECTION_UNLOCK(upstream);
|
||||
|
||||
CONNECTION_LOCK(client);
|
||||
if ( client->c_state == SLAP_C_BINDING ) {
|
||||
if ( client->c_state == LLOAD_C_BINDING ) {
|
||||
switch ( result ) {
|
||||
case LDAP_SASL_BIND_IN_PROGRESS:
|
||||
break;
|
||||
case LDAP_SUCCESS:
|
||||
default: {
|
||||
client->c_state = SLAP_C_READY;
|
||||
client->c_type = SLAP_C_OPEN;
|
||||
client->c_state = LLOAD_C_READY;
|
||||
client->c_type = LLOAD_C_OPEN;
|
||||
if ( result != LDAP_SUCCESS ) {
|
||||
ber_memfree( client->c_auth.bv_val );
|
||||
BER_BVZERO( &client->c_auth );
|
||||
} else if ( !ber_bvstrcasecmp(
|
||||
&client->c_auth, &lloadd_identity ) ) {
|
||||
client->c_type = SLAP_C_PRIVILEGED;
|
||||
client->c_type = LLOAD_C_PRIVILEGED;
|
||||
}
|
||||
if ( !BER_BVISNULL( &client->c_sasl_bind_mech ) ) {
|
||||
ber_memfree( client->c_sasl_bind_mech.bv_val );
|
||||
|
|
@ -146,8 +146,8 @@ handle_bind_response( Operation *op, BerElement *ber )
|
|||
}
|
||||
}
|
||||
} else {
|
||||
assert( client->c_state == SLAP_C_INVALID ||
|
||||
client->c_state == SLAP_C_CLOSING );
|
||||
assert( client->c_state == LLOAD_C_INVALID ||
|
||||
client->c_state == LLOAD_C_CLOSING );
|
||||
}
|
||||
CONNECTION_UNLOCK(client);
|
||||
|
||||
|
|
@ -232,20 +232,20 @@ handle_vc_bind_response( Operation *op, BerElement *ber )
|
|||
}
|
||||
}
|
||||
|
||||
if ( c->c_state == SLAP_C_BINDING ) {
|
||||
if ( c->c_state == LLOAD_C_BINDING ) {
|
||||
switch ( result ) {
|
||||
case LDAP_SASL_BIND_IN_PROGRESS:
|
||||
break;
|
||||
case LDAP_SUCCESS:
|
||||
default: {
|
||||
c->c_state = SLAP_C_READY;
|
||||
c->c_type = SLAP_C_OPEN;
|
||||
c->c_state = LLOAD_C_READY;
|
||||
c->c_type = LLOAD_C_OPEN;
|
||||
if ( result != LDAP_SUCCESS ) {
|
||||
ber_memfree( c->c_auth.bv_val );
|
||||
BER_BVZERO( &c->c_auth );
|
||||
} else if ( !ber_bvstrcasecmp(
|
||||
&c->c_auth, &lloadd_identity ) ) {
|
||||
c->c_type = SLAP_C_PRIVILEGED;
|
||||
c->c_type = LLOAD_C_PRIVILEGED;
|
||||
}
|
||||
if ( !BER_BVISNULL( &c->c_vc_cookie ) ) {
|
||||
ber_memfree( c->c_vc_cookie.bv_val );
|
||||
|
|
@ -259,7 +259,8 @@ handle_vc_bind_response( Operation *op, BerElement *ber )
|
|||
}
|
||||
}
|
||||
} else {
|
||||
assert( c->c_state == SLAP_C_INVALID || c->c_state == SLAP_C_CLOSING );
|
||||
assert( c->c_state == LLOAD_C_INVALID ||
|
||||
c->c_state == LLOAD_C_CLOSING );
|
||||
}
|
||||
CONNECTION_UNLOCK_INCREF(c);
|
||||
|
||||
|
|
@ -296,8 +297,8 @@ done:
|
|||
static int
|
||||
handle_unsolicited( Connection *c, BerElement *ber )
|
||||
{
|
||||
if ( c->c_state == SLAP_C_READY ) {
|
||||
c->c_state = SLAP_C_CLOSING;
|
||||
if ( c->c_state == LLOAD_C_READY ) {
|
||||
c->c_state = LLOAD_C_CLOSING;
|
||||
}
|
||||
|
||||
Debug( LDAP_DEBUG_CONNS, "handle_unsolicited: "
|
||||
|
|
@ -445,8 +446,8 @@ handle_one_response( Connection *c )
|
|||
CONNECTION_LOCK_DECREF(c);
|
||||
op->o_upstream_refcnt--;
|
||||
if ( !client || !op->o_upstream_refcnt ) {
|
||||
if ( c->c_state == SLAP_C_BINDING ) {
|
||||
c->c_state = SLAP_C_READY;
|
||||
if ( c->c_state == LLOAD_C_BINDING ) {
|
||||
c->c_state = LLOAD_C_READY;
|
||||
}
|
||||
operation_destroy_from_upstream( op );
|
||||
}
|
||||
|
|
@ -500,8 +501,8 @@ upstream_bind_cb( Connection *c )
|
|||
switch ( result ) {
|
||||
case LDAP_SUCCESS: {
|
||||
c->c_pdu_cb = handle_one_response;
|
||||
c->c_state = SLAP_C_READY;
|
||||
c->c_type = SLAP_C_OPEN;
|
||||
c->c_state = LLOAD_C_READY;
|
||||
c->c_type = LLOAD_C_OPEN;
|
||||
CONNECTION_UNLOCK_INCREF(c);
|
||||
ldap_pvt_thread_mutex_lock( &b->b_mutex );
|
||||
LDAP_CIRCLEQ_REMOVE( &b->b_preparing, c, c_next );
|
||||
|
|
@ -611,16 +612,16 @@ upstream_finish( Connection *c )
|
|||
if ( is_bindconn ) {
|
||||
LDAP_CIRCLEQ_REMOVE( &b->b_preparing, c, c_next );
|
||||
LDAP_CIRCLEQ_INSERT_HEAD( &b->b_bindconns, c, c_next );
|
||||
c->c_state = SLAP_C_READY;
|
||||
c->c_type = SLAP_C_BIND;
|
||||
c->c_state = LLOAD_C_READY;
|
||||
c->c_type = LLOAD_C_BIND;
|
||||
b->b_bindavail++;
|
||||
b->b_opening--;
|
||||
b->b_failed = 0;
|
||||
} else if ( bindconf.sb_method == LDAP_AUTH_NONE ) {
|
||||
LDAP_CIRCLEQ_REMOVE( &b->b_preparing, c, c_next );
|
||||
LDAP_CIRCLEQ_INSERT_HEAD( &b->b_conns, c, c_next );
|
||||
c->c_state = SLAP_C_READY;
|
||||
c->c_type = SLAP_C_OPEN;
|
||||
c->c_state = LLOAD_C_READY;
|
||||
c->c_type = LLOAD_C_OPEN;
|
||||
b->b_active++;
|
||||
b->b_opening--;
|
||||
b->b_failed = 0;
|
||||
|
|
@ -659,7 +660,7 @@ upstream_init( ber_socket_t s, Backend *b )
|
|||
c->c_pdu_cb = handle_one_response;
|
||||
|
||||
LDAP_CIRCLEQ_INSERT_HEAD( &b->b_preparing, c, c_next );
|
||||
c->c_type = SLAP_C_PREPARING;
|
||||
c->c_type = LLOAD_C_PREPARING;
|
||||
|
||||
{
|
||||
ber_len_t max = sockbuf_max_incoming_upstream;
|
||||
|
|
@ -712,7 +713,7 @@ fail:
|
|||
event_free( c->c_read_event );
|
||||
}
|
||||
|
||||
c->c_state = SLAP_C_INVALID;
|
||||
c->c_state = LLOAD_C_INVALID;
|
||||
CONNECTION_DESTROY(c);
|
||||
assert( c == NULL );
|
||||
|
||||
|
|
@ -732,9 +733,9 @@ upstream_destroy( Connection *c )
|
|||
"freeing connection connid=%lu\n",
|
||||
c->c_connid );
|
||||
|
||||
assert( c->c_state != SLAP_C_INVALID );
|
||||
assert( c->c_state != LLOAD_C_INVALID );
|
||||
state = c->c_state;
|
||||
c->c_state = SLAP_C_INVALID;
|
||||
c->c_state = LLOAD_C_INVALID;
|
||||
|
||||
root = c->c_ops;
|
||||
c->c_ops = NULL;
|
||||
|
|
@ -763,13 +764,13 @@ upstream_destroy( Connection *c )
|
|||
}
|
||||
|
||||
/* Remove from the backend on first pass */
|
||||
if ( state != SLAP_C_CLOSING ) {
|
||||
if ( state != LLOAD_C_CLOSING ) {
|
||||
ldap_pvt_thread_mutex_lock( &b->b_mutex );
|
||||
if ( c->c_type == SLAP_C_PREPARING ) {
|
||||
if ( c->c_type == LLOAD_C_PREPARING ) {
|
||||
LDAP_CIRCLEQ_REMOVE( &b->b_preparing, c, c_next );
|
||||
b->b_opening--;
|
||||
b->b_failed++;
|
||||
} else if ( c->c_type == SLAP_C_BIND ) {
|
||||
} else if ( c->c_type == LLOAD_C_BIND ) {
|
||||
LDAP_CIRCLEQ_REMOVE( &b->b_bindconns, c, c_next );
|
||||
b->b_bindavail--;
|
||||
} else {
|
||||
|
|
@ -800,7 +801,7 @@ upstream_destroy( Connection *c )
|
|||
*/
|
||||
assert( c->c_refcnt >= 0 );
|
||||
if ( c->c_refcnt ) {
|
||||
c->c_state = SLAP_C_CLOSING;
|
||||
c->c_state = LLOAD_C_CLOSING;
|
||||
Debug( LDAP_DEBUG_CONNS, "upstream_destroy: "
|
||||
"connid=%lu aborting with refcnt=%d\n",
|
||||
c->c_connid, c->c_refcnt );
|
||||
|
|
|
|||
Loading…
Reference in a new issue