diff --git a/servers/slapd/add.c b/servers/slapd/add.c index cfff625602..683a7649c3 100644 --- a/servers/slapd/add.c +++ b/servers/slapd/add.c @@ -117,7 +117,7 @@ do_add( Connection *conn, Operation *op ) } Statslog( LDAP_DEBUG_STATS, "conn=%d op=%d ADD dn=\"%s\"\n", - conn->c_connid, op->o_opid, e->e_ndn, 0, 0 ); + op->o_connid, op->o_opid, e->e_ndn, 0, 0 ); /* * We could be serving multiple database backends. Select the diff --git a/servers/slapd/bind.c b/servers/slapd/bind.c index c8daed7bfe..c09d4098e7 100644 --- a/servers/slapd/bind.c +++ b/servers/slapd/bind.c @@ -154,7 +154,7 @@ do_bind( ndn = dn_normalize_case( ch_strdup( cdn ) ); Statslog( LDAP_DEBUG_STATS, "conn=%d op=%d BIND dn=\"%s\" method=%d\n", - conn->c_connid, op->o_opid, ndn, method, 0 ); + op->o_connid, op->o_opid, ndn, method, 0 ); if ( version < LDAP_VERSION_MIN || version > LDAP_VERSION_MAX ) { Debug( LDAP_DEBUG_ANY, "unknown version %d\n", version, 0, 0 ); diff --git a/servers/slapd/compare.c b/servers/slapd/compare.c index 29a7c80962..c617be2028 100644 --- a/servers/slapd/compare.c +++ b/servers/slapd/compare.c @@ -74,7 +74,7 @@ do_compare( ndn = dn_normalize_case( ndn ); Statslog( LDAP_DEBUG_STATS, "conn=%d op=%d CMP dn=\"%s\" attr=\"%s\"\n", - conn->c_connid, op->o_opid, ndn, ava.ava_type, 0 ); + op->o_connid, op->o_opid, ndn, ava.ava_type, 0 ); /* * We could be serving multiple database backends. Select the diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index 0ff5d2a8cd..b05c8fbf0a 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -421,6 +421,7 @@ connection_destroy( Connection *c ) backend_connection_destroy(c); c->c_protocol = 0; + c->c_connid = -1; c->c_activitytime = c->c_starttime = 0; @@ -990,6 +991,7 @@ static int connection_op_activate( Connection *conn, Operation *op ) arg->co_op->o_ndn = dn_normalize_case( ch_strdup( arg->co_op->o_dn ) ); arg->co_op->o_protocol = conn->c_protocol; + arg->co_op->o_connid = conn->c_connid; arg->co_op->o_authtype = conn->c_authtype; arg->co_op->o_authmech = conn->c_authmech != NULL diff --git a/servers/slapd/modify.c b/servers/slapd/modify.c index 340263037e..016033742c 100644 --- a/servers/slapd/modify.c +++ b/servers/slapd/modify.c @@ -151,7 +151,7 @@ do_modify( } Statslog( LDAP_DEBUG_STATS, "conn=%d op=%d MOD dn=\"%s\"\n", - conn->c_connid, op->o_opid, ndn, 0, 0 ); + op->o_connid, op->o_opid, ndn, 0, 0 ); /* * We could be serving multiple database backends. Select the diff --git a/servers/slapd/modrdn.c b/servers/slapd/modrdn.c index 482a9bdd74..59ce22cdea 100644 --- a/servers/slapd/modrdn.c +++ b/servers/slapd/modrdn.c @@ -170,7 +170,7 @@ do_modrdn( dn_normalize_case( ndn ); Statslog( LDAP_DEBUG_STATS, "conn=%d op=%d MODRDN dn=\"%s\"\n", - conn->c_connid, op->o_opid, ndn, 0, 0 ); + op->o_connid, op->o_opid, ndn, 0, 0 ); /* * We could be serving multiple database backends. Select the diff --git a/servers/slapd/result.c b/servers/slapd/result.c index 246a007764..0fcad46726 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -342,7 +342,7 @@ send_ldap_disconnect( Statslog( LDAP_DEBUG_STATS, "conn=%ld op=%ld DISCONNECT err=%ld tag=%lu text=%s\n", - (long) conn->c_connid, (long) op->o_opid, + (long) op->o_connid, (long) op->o_opid, (long) tag, (long) err, text ); } @@ -363,7 +363,9 @@ send_ldap_result( assert( !LDAP_API_ERROR( err ) ); - Debug( LDAP_DEBUG_TRACE, "send_ldap_result %d:%s:%s\n", + Debug( LDAP_DEBUG_TRACE, "send_ldap_result: conn=%ld op=%ld p=%d\n", + (long) op->o_connid, (long) op->o_opid, op->o_protocol ); + Debug( LDAP_DEBUG_ARGS, "send_ldap_result: %d:%s:%s\n", err, matched ? matched : "", text ? text : "" ); assert( err != LDAP_PARTIAL_RESULTS ); @@ -402,7 +404,7 @@ send_ldap_result( Statslog( LDAP_DEBUG_STATS, "conn=%ld op=%ld RESULT err=%ld tag=%lu text=%s\n", - (long) conn->c_connid, (long) op->o_opid, + (long) op->o_connid, (long) op->o_opid, (long) err, (long) tag, text ); if( tmp != NULL ) { @@ -471,7 +473,7 @@ send_search_result( Statslog( LDAP_DEBUG_STATS, "conn=%ld op=%ld SEARCH RESULT err=%ld tag=%lu text=%s\n", - (long) conn->c_connid, (long) op->o_opid, + (long) op->o_connid, (long) op->o_opid, (long) err, (long) tag, text ); } diff --git a/servers/slapd/search.c b/servers/slapd/search.c index b9906a12c9..92a34841bf 100644 --- a/servers/slapd/search.c +++ b/servers/slapd/search.c @@ -153,7 +153,7 @@ do_search( Statslog( LDAP_DEBUG_STATS, "conn=%d op=%d SRCH base=\"%s\" scope=%d filter=\"%s\"\n", - conn->c_connid, op->o_opid, base, scope, fstr ); + op->o_connid, op->o_opid, base, scope, fstr ); if ( scope == LDAP_SCOPE_BASE ) { #if defined( SLAPD_MONITOR_DN ) diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 439ebd6853..75a61b0ae2 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -549,7 +549,7 @@ typedef struct slap_op { LDAPControl **o_ctrls; /* controls */ -/* long o_connid; *//* id of conn initiating this op */ + unsigned long o_connid; /* id of conn initiating this op */ #ifdef LDAP_CONNECTIONLESS int o_cldap; /* != 0 if this came in via CLDAP */ diff --git a/servers/slapd/unbind.c b/servers/slapd/unbind.c index 72342b7b70..da6e1cd7c7 100644 --- a/servers/slapd/unbind.c +++ b/servers/slapd/unbind.c @@ -36,7 +36,7 @@ do_unbind( * UnBindRequest ::= NULL */ - Statslog( LDAP_DEBUG_STATS, "conn=%d op=%d UNBIND\n", conn->c_connid, + Statslog( LDAP_DEBUG_STATS, "conn=%d op=%d UNBIND\n", op->o_connid, op->o_opid, 0, 0, 0 ); /* pass the unbind to all backends */