mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
Add c_conn_idx, to simplify external modules managing per-connection state
This commit is contained in:
parent
95459fef7f
commit
cdeda34029
@ -92,6 +92,8 @@ static ldap_pvt_thread_start_t connection_operation;
|
|||||||
*/
|
*/
|
||||||
int connections_init(void)
|
int connections_init(void)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
assert( connections == NULL );
|
assert( connections == NULL );
|
||||||
|
|
||||||
if( connections != NULL) {
|
if( connections != NULL) {
|
||||||
@ -126,6 +128,8 @@ int connections_init(void)
|
|||||||
assert( connections[0].c_struct_state == SLAP_C_UNINITIALIZED );
|
assert( connections[0].c_struct_state == SLAP_C_UNINITIALIZED );
|
||||||
assert( connections[dtblsize-1].c_struct_state == SLAP_C_UNINITIALIZED );
|
assert( connections[dtblsize-1].c_struct_state == SLAP_C_UNINITIALIZED );
|
||||||
|
|
||||||
|
for (i=0; i<dtblsize; i++) connections[i].c_conn_idx = i;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* per entry initialization of the Connection array initialization
|
* per entry initialization of the Connection array initialization
|
||||||
* will be done by connection_init()
|
* will be done by connection_init()
|
||||||
|
@ -2148,6 +2148,7 @@ typedef struct slap_listener Listener;
|
|||||||
typedef struct slap_conn {
|
typedef struct slap_conn {
|
||||||
int c_struct_state; /* structure management state */
|
int c_struct_state; /* structure management state */
|
||||||
int c_conn_state; /* connection state */
|
int c_conn_state; /* connection state */
|
||||||
|
int c_conn_idx; /* slot in connections array */
|
||||||
|
|
||||||
ldap_pvt_thread_mutex_t c_mutex; /* protect the connection */
|
ldap_pvt_thread_mutex_t c_mutex; /* protect the connection */
|
||||||
Sockbuf *c_sb; /* ber connection stuff */
|
Sockbuf *c_sb; /* ber connection stuff */
|
||||||
|
Loading…
Reference in New Issue
Block a user