]> git.sur5r.net Git - openldap/commitdiff
ITS#7182 Keep connection IDs for monitoring purposes.
authorOndrej Kuznik <ondrej.kuznik@acision.com>
Thu, 29 Mar 2012 12:28:40 +0000 (14:28 +0200)
committerHoward Chu <hyc@openldap.org>
Thu, 29 Mar 2012 14:00:56 +0000 (07:00 -0700)
servers/slapd/back-ldap/back-ldap.h
servers/slapd/back-ldap/bind.c

index 0ae3d48a94058c1c8ef1f1ee95e6ce26f9324267..56cb36acbf5e430f6b202d1d511dcc6b0e8f60e3 100644 (file)
@@ -175,6 +175,7 @@ typedef struct ldapconn_t {
 #define        LDAP_BACK_CONN_CACHED_CLEAR(lc)         LDAP_BACK_CONN_CLEAR((lc), LDAP_BACK_FCONN_CACHED)
 
        LDAP                    *lc_ld;
+       unsigned long           lc_connid;
        struct berval           lc_cred;
        struct berval           lc_bound_ndn;
        unsigned                lc_flags;
@@ -379,6 +380,8 @@ typedef struct ldapinfo_t {
 
        int                     li_version;
 
+       unsigned long           li_conn_nextid;
+
        /* cached connections; 
         * special conns are in tailq rather than in tree */
        ldap_avl_info_t         li_conninfo;
index 03c54e473f0c3b64aa75c9f7501234cee3afff84..01f4173a5f5cdc251b14f577ab70724dc759c58a 100644 (file)
@@ -1066,6 +1066,7 @@ retry_lock:
                ldap_pvt_thread_mutex_lock( &li->li_conninfo.lai_mutex );
 
                LDAP_BACK_CONN_ISBOUND_CLEAR( lc );
+               lc->lc_connid = li->li_conn_nextid++;
 
                assert( lc->lc_refcnt == 1 );