From 9ca9459ecedc93548d6c447813001f7a38a0b3b6 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 3 Feb 2011 20:47:38 +0000 Subject: [PATCH] More for overlay use, add connid extension --- servers/slapd/back-sock/back-sock.h | 1 + servers/slapd/back-sock/config.c | 14 ++++++++++++++ servers/slapd/back-sock/result.c | 3 +++ 3 files changed, 18 insertions(+) diff --git a/servers/slapd/back-sock/back-sock.h b/servers/slapd/back-sock/back-sock.h index 3c05cf3c4d..10bebd6e1b 100644 --- a/servers/slapd/back-sock/back-sock.h +++ b/servers/slapd/back-sock/back-sock.h @@ -33,6 +33,7 @@ struct sockinfo { #define SOCK_EXT_BINDDN 1 #define SOCK_EXT_PEERNAME 2 #define SOCK_EXT_SSF 4 +#define SOCK_EXT_CONNID 8 extern FILE *opensock LDAP_P(( const char *sockpath)); diff --git a/servers/slapd/back-sock/config.c b/servers/slapd/back-sock/config.c index 32166bb936..d07d0cef11 100644 --- a/servers/slapd/back-sock/config.c +++ b/servers/slapd/back-sock/config.c @@ -77,6 +77,7 @@ static slap_verbmasks bs_exts[] = { { BER_BVC("binddn"), SOCK_EXT_BINDDN }, { BER_BVC("peername"), SOCK_EXT_PEERNAME }, { BER_BVC("ssf"), SOCK_EXT_SSF }, + { BER_BVC("connid"), SOCK_EXT_CONNID }, { BER_BVNULL, 0 } }; @@ -158,6 +159,7 @@ static int sock_over_op( { slap_overinst *on = (slap_overinst *)op->o_bd->bd_info; void *private = op->o_bd->be_private; + slap_callback cb = { NULL, slap_null_cb, NULL, NULL }; slap_operation_t which; int rc; @@ -174,11 +176,22 @@ static int sock_over_op( return SLAP_CB_CONTINUE; } op->o_bd->be_private = on->on_bi.bi_private; + cb.sc_next = op->o_callback; + op->o_callback = &cb; rc = sockfuncs[which]( op, rs ); op->o_bd->be_private = private; + op->o_callback = cb.sc_next; return rc; } +static int +sock_over_response( Operatiion *op, SlapReply *rs ) +{ + slap_overinst *on = (slap_overinst *)op->o_bd->bd_info; + struct sockinfo *si = (struct sockinfo *)on->on_bi.bi_private; + +} + static int sock_over_setup() { @@ -196,6 +209,7 @@ sock_over_setup() sockover.on_bi.bi_op_modrdn = sock_over_op; sockover.on_bi.bi_op_add = sock_over_op; sockover.on_bi.bi_op_delete = sock_over_op; + sockover.on_response = sock_over_response; sockover.on_bi.bi_cf_ocs = osocs; diff --git a/servers/slapd/back-sock/result.c b/servers/slapd/back-sock/result.c index 085e79d5a5..63cdc9be36 100644 --- a/servers/slapd/back-sock/result.c +++ b/servers/slapd/back-sock/result.c @@ -151,4 +151,7 @@ sock_print_conn( if( si->si_extensions & SOCK_EXT_SSF ) { fprintf( fp, "ssf: %d\n", conn->c_ssf ); } + if( si->si_extensions & SOCK_EXT_CONNID ) { + fprintf( fp, "connid: %lu\n", conn->c_connid ); + } } -- 2.39.5