]> git.sur5r.net Git - openldap/commitdiff
allow to look-ahead entry DN without decoding the whole entry (ITS#6442)
authorQuanah Gibson-Mount <quanah@openldap.org>
Fri, 16 Apr 2010 17:03:36 +0000 (17:03 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Fri, 16 Apr 2010 17:03:36 +0000 (17:03 +0000)
servers/slapd/entry.c
servers/slapd/proto-slap.h
servers/slapd/slap.h

index e94aa20d98e993a92d341dee392668e969ea9c6a..07ee45811310c868c5134b29ef842aa123118a35 100644 (file)
@@ -820,6 +820,35 @@ int entry_header(EntryHeader *eh)
        return LDAP_SUCCESS;
 }
 
+int
+entry_decode_dn( EntryHeader *eh, struct berval *dn, struct berval *ndn )
+{
+       int i;
+       unsigned char *ptr = (unsigned char *)eh->bv.bv_val;
+
+       assert( dn != NULL || ndn != NULL );
+
+       ptr = (unsigned char *)eh->data;
+       i = entry_getlen(&ptr);
+       if ( dn != NULL ) {
+               dn->bv_val = (char *) ptr;
+               dn->bv_len = i;
+       }
+
+       if ( ndn != NULL ) {
+               ptr += i + 1;
+               i = entry_getlen(&ptr);
+               ndn->bv_val = (char *) ptr;
+               ndn->bv_len = i;
+       }
+
+       Debug( LDAP_DEBUG_TRACE,
+               "entry_decode_dn: \"%s\"\n",
+               dn ? dn->bv_val : ndn->bv_val, 0, 0 );
+
+       return 0;
+}
+
 #ifdef SLAP_ZONE_ALLOC
 int entry_decode(EntryHeader *eh, Entry **e, void *ctx)
 #else
index e27c119c67b3c3fee7956dbe3459df3a01c8a222..fb8b29515e3a84760d4340510f1c7ec6527fc05d 100644 (file)
@@ -985,6 +985,8 @@ LDAP_SLAPD_F (void) entry_partsize LDAP_P(( Entry *e, ber_len_t *len,
        int *nattrs, int *nvals, int norm ));
 
 LDAP_SLAPD_F (int) entry_header LDAP_P(( EntryHeader *eh ));
+LDAP_SLAPD_F (int) entry_decode_dn LDAP_P((
+       EntryHeader *eh, struct berval *dn, struct berval *ndn ));
 #ifdef SLAP_ZONE_ALLOC
 LDAP_SLAPD_F (int) entry_decode LDAP_P((
                                                EntryHeader *eh, Entry **e, void *ctx ));
index 8e37d089490b789e2d13f853d73b42753ed00dc5..0c02b00d116b877571e8d157ef125434f47082b4 100644 (file)
@@ -1592,6 +1592,12 @@ LDAP_SLAPD_V (int) slapMode;
 #define SB_TLS_ON              1
 #define SB_TLS_CRITICAL                2
 
+typedef struct slap_keepalive {
+       int sk_idle;
+       int sk_probes;
+       int sk_interval;
+} slap_keepalive;
+
 typedef struct slap_bindconf {
        struct berval sb_uri;
        int sb_version;
@@ -1606,6 +1612,7 @@ typedef struct slap_bindconf {
        struct berval sb_realm;
        struct berval sb_authcId;
        struct berval sb_authzId;
+       slap_keepalive sb_keepalive;
 #ifdef HAVE_TLS
        void *sb_tls_ctx;
        char *sb_tls_cert;
@@ -1635,6 +1642,14 @@ typedef struct slap_cf_aux_table {
        void *aux;
 } slap_cf_aux_table;
 
+typedef int 
+slap_cf_aux_table_parse_x LDAP_P((
+       struct berval *val,
+       void *bc,
+       slap_cf_aux_table *tab0,
+       const char *tabmsg,
+       int unparse ));
+
 typedef int 
 slap_cf_aux_table_parse_x LDAP_P((
        struct berval *val,