]> git.sur5r.net Git - openldap/commitdiff
Add c_conn_idx, to simplify external modules managing per-connection state
authorHoward Chu <hyc@openldap.org>
Fri, 12 Mar 2004 18:22:37 +0000 (18:22 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 12 Mar 2004 18:22:37 +0000 (18:22 +0000)
servers/slapd/connection.c
servers/slapd/slap.h

index 6e2c934847980ae44c92d2f1a0a85e9045a3a991..b394cc062e0b2a9ea11a18e7c99fd278cf488c09 100644 (file)
@@ -92,6 +92,8 @@ static ldap_pvt_thread_start_t connection_operation;
  */
 int connections_init(void)
 {
+       int i;
+
        assert( connections == NULL );
 
        if( connections != NULL) {
@@ -126,6 +128,8 @@ int connections_init(void)
        assert( connections[0].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
         * will be done by connection_init()
index 202cc068ee343b1484a8756af1c4b4b20626f0da..0112072d57e529a7536c099f32c38d6e38956cf7 100644 (file)
@@ -2148,6 +2148,7 @@ typedef struct slap_listener Listener;
 typedef struct slap_conn {
        int                     c_struct_state; /* structure management 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 */
        Sockbuf         *c_sb;                  /* ber connection stuff           */