mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-30 13:30:57 +08:00
Move connection state enums to slap.h to ease debugging
This commit is contained in:
parent
198cbd6ea8
commit
2f351f964d
@ -52,24 +52,6 @@ static unsigned long conn_nextid = 0;
|
||||
|
||||
static const char conn_lost_str[] = "connection lost";
|
||||
|
||||
/* structure state (protected by connections_mutex) */
|
||||
enum sc_struct_state {
|
||||
SLAP_C_UNINITIALIZED = 0, /* MUST BE ZERO (0) */
|
||||
SLAP_C_UNUSED,
|
||||
SLAP_C_USED,
|
||||
SLAP_C_PENDING
|
||||
};
|
||||
|
||||
/* connection state (protected by c_mutex ) */
|
||||
enum sc_conn_state {
|
||||
SLAP_C_INVALID = 0, /* MUST BE ZERO (0) */
|
||||
SLAP_C_INACTIVE, /* zero threads */
|
||||
SLAP_C_CLOSING, /* closing */
|
||||
SLAP_C_ACTIVE, /* one or more threads */
|
||||
SLAP_C_BINDING, /* binding */
|
||||
SLAP_C_CLIENT /* outbound client conn */
|
||||
};
|
||||
|
||||
const char *
|
||||
connection_state2str( int state )
|
||||
{
|
||||
|
@ -2762,9 +2762,26 @@ typedef struct Listener Listener;
|
||||
/*
|
||||
* represents a connection from an ldap client
|
||||
*/
|
||||
/* structure state (protected by connections_mutex) */
|
||||
enum sc_struct_state {
|
||||
SLAP_C_UNINITIALIZED = 0, /* MUST BE ZERO (0) */
|
||||
SLAP_C_UNUSED,
|
||||
SLAP_C_USED,
|
||||
SLAP_C_PENDING
|
||||
};
|
||||
|
||||
/* connection state (protected by c_mutex ) */
|
||||
enum sc_conn_state {
|
||||
SLAP_C_INVALID = 0, /* MUST BE ZERO (0) */
|
||||
SLAP_C_INACTIVE, /* zero threads */
|
||||
SLAP_C_CLOSING, /* closing */
|
||||
SLAP_C_ACTIVE, /* one or more threads */
|
||||
SLAP_C_BINDING, /* binding */
|
||||
SLAP_C_CLIENT /* outbound client conn */
|
||||
};
|
||||
struct Connection {
|
||||
int c_struct_state; /* structure management state */
|
||||
int c_conn_state; /* connection state */
|
||||
enum sc_struct_state c_struct_state; /* structure management state */
|
||||
enum sc_conn_state c_conn_state; /* connection state */
|
||||
int c_conn_idx; /* slot in connections array */
|
||||
ber_socket_t c_sd;
|
||||
const char *c_close_reason; /* why connection is closing */
|
||||
|
Loading…
Reference in New Issue
Block a user