]> git.sur5r.net Git - openldap/commitdiff
More for overlay use, add connid extension
authorHoward Chu <hyc@openldap.org>
Thu, 3 Feb 2011 20:47:38 +0000 (20:47 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 3 Feb 2011 20:47:38 +0000 (20:47 +0000)
servers/slapd/back-sock/back-sock.h
servers/slapd/back-sock/config.c
servers/slapd/back-sock/result.c

index 3c05cf3c4dbf1e942c01fa6850baf28f14337380..10bebd6e1bc159302e54d9fd1fe83d9b1c1a1a92 100644 (file)
@@ -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));
index 32166bb936c77dd2063d0291bec14a36d23893ce..d07d0cef11845103af1864e71ba2c93ca2cc51c0 100644 (file)
@@ -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;
 
index 085e79d5a5d29bf1730e224a7bb89f47bb9b2d09..63cdc9be36afd865109e1d9c047ac9e1f0284d13 100644 (file)
@@ -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 );
+       }
 }