]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/connection.c
error message from be_entry_put tool backend function
[openldap] / servers / slapd / connection.c
index 93ae38654d2b8c780ba0d4b32e339cf4aeb11aac..766ca439bf0ce53f5c10611bfe00a655a4ff1c87 100644 (file)
@@ -417,7 +417,8 @@ long connection_init(
                c->c_dn.bv_len = 0;
                c->c_ndn.bv_val = NULL;
                c->c_ndn.bv_len = 0;
-               c->c_cdn = NULL;
+               c->c_cdn.bv_val = NULL;
+               c->c_cdn.bv_len = 0;
                c->c_groups = NULL;
 
                c->c_listener_url = NULL;
@@ -455,7 +456,7 @@ long connection_init(
        assert( c->c_authmech == NULL );
     assert(    c->c_dn.bv_val == NULL );
     assert(    c->c_ndn.bv_val == NULL );
-    assert(    c->c_cdn == NULL );
+    assert(    c->c_cdn.bv_val == NULL );
     assert( c->c_groups == NULL );
     assert( c->c_listener_url == NULL );
     assert( c->c_peer_domain == NULL );
@@ -504,6 +505,8 @@ long connection_init(
 #endif
        ber_sockbuf_add_io( c->c_sb, &ber_sockbuf_io_udp,
                LBER_SBIOD_LEVEL_PROVIDER, (void *)&s );
+       ber_sockbuf_add_io( c->c_sb, &ber_sockbuf_io_readahead,
+               LBER_SBIOD_LEVEL_PROVIDER, NULL );
        } else
 #endif
        {
@@ -514,8 +517,6 @@ long connection_init(
        ber_sockbuf_add_io( c->c_sb, &ber_sockbuf_io_tcp,
                LBER_SBIOD_LEVEL_PROVIDER, (void *)&s );
        }
-       ber_sockbuf_add_io( c->c_sb, &ber_sockbuf_io_readahead,
-               LBER_SBIOD_LEVEL_PROVIDER, NULL );
 
 #ifdef LDAP_DEBUG
        ber_sockbuf_add_io( c->c_sb, &ber_sockbuf_io_debug,
@@ -591,10 +592,11 @@ void connection2anonymous( Connection *c )
     }
     c->c_ndn.bv_len = 0;
 
-       if(c->c_cdn != NULL) {
-               free(c->c_cdn);
-               c->c_cdn = NULL;
+       if(c->c_cdn.bv_val != NULL) {
+               free(c->c_cdn.bv_val);
+               c->c_cdn.bv_val = NULL;
        }
+       c->c_cdn.bv_len = 0;
 
        c->c_authc_backend = NULL;
        c->c_authz_backend = NULL;