From 7c40b6e904ac3a1286f1436f84d4ce03259d8ad4 Mon Sep 17 00:00:00 2001 From: Ondrej Kuznik Date: Thu, 29 Mar 2012 14:28:40 +0200 Subject: [PATCH] ITS#7182 Keep connection IDs for monitoring purposes. --- servers/slapd/back-ldap/back-ldap.h | 3 +++ servers/slapd/back-ldap/bind.c | 1 + 2 files changed, 4 insertions(+) diff --git a/servers/slapd/back-ldap/back-ldap.h b/servers/slapd/back-ldap/back-ldap.h index 0ae3d48a94..56cb36acbf 100644 --- a/servers/slapd/back-ldap/back-ldap.h +++ b/servers/slapd/back-ldap/back-ldap.h @@ -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; diff --git a/servers/slapd/back-ldap/bind.c b/servers/slapd/back-ldap/bind.c index 03c54e473f..01f4173a5f 100644 --- a/servers/slapd/back-ldap/bind.c +++ b/servers/slapd/back-ldap/bind.c @@ -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 ); -- 2.39.5