]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/connection.c
Fixup bdb_entry_release now that entry_decode uses two memory blocks
[openldap] / servers / slapd / connection.c
index dd58fd82c3285e997ac435504fc2218ed019955a..88a701c8be047f982dfbe0aac9c4903eb02cfafa 100644 (file)
@@ -14,6 +14,7 @@
 #include <ac/signal.h>
 #include <ac/string.h>
 #include <ac/time.h>
+#include <ac/unistd.h>
 
 #include "ldap_pvt.h"
 #include "lutil.h"
@@ -300,7 +301,13 @@ static Connection* connection_get( ber_socket_t s )
                assert( c->c_conn_state != SLAP_C_INVALID );
                assert( sd != AC_SOCKET_INVALID );
 
-       c->c_activitytime = slap_get_time();
+#ifdef SLAPD_MONITOR
+               c->c_activitytime = slap_get_time();
+#else
+               if( global_idletimeout > 0 ) {
+                       c->c_activitytime = slap_get_time();
+               }
+#endif
        }
 
        return c;
@@ -408,6 +415,7 @@ long connection_init(
                c->c_authmech = NULL;
                c->c_dn = NULL;
                c->c_cdn = NULL;
+               c->c_groups = NULL;
 
                c->c_listener_url = NULL;
                c->c_peer_domain = NULL;
@@ -444,6 +452,7 @@ long connection_init(
        assert( c->c_authmech == NULL );
     assert(    c->c_dn == NULL );
     assert(    c->c_cdn == NULL );
+    assert( c->c_groups == NULL );
     assert( c->c_listener_url == NULL );
     assert( c->c_peer_domain == NULL );
     assert( c->c_peer_name == NULL );
@@ -472,7 +481,13 @@ long connection_init(
        /* set to zero until bind, implies LDAP_VERSION3 */
        c->c_protocol = 0;
 
-    c->c_activitytime = c->c_starttime = slap_get_time();
+#ifdef SLAPD_MONITOR
+       c->c_activitytime = c->c_starttime = slap_get_time();
+#else
+       if( global_idletimeout > 0 ) {
+               c->c_activitytime = c->c_starttime = slap_get_time();
+       }
+#endif
 
 #ifdef LDAP_CONNECTIONLESS
        c->c_is_udp = 0;
@@ -573,6 +588,17 @@ void connection2anonymous( Connection *c )
 
        c->c_authc_backend = NULL;
        c->c_authz_backend = NULL;
+    
+    {
+       GroupAssertion *g, *n;
+       for (g = c->c_groups; g; g=n)
+       {
+           n = g->next;
+           free(g);
+       }
+       c->c_groups = NULL;
+    }
+
 }
 
 static void
@@ -1038,8 +1064,10 @@ int connection_read(ber_socket_t s)
        if ( c->c_is_tls && c->c_needs_tls_accept ) {
                rc = ldap_pvt_tls_accept( c->c_sb, NULL );
                if ( rc < 0 ) {
+#if 0 /* required by next #if 0 */
                        struct timeval tv;
                        fd_set rfd;
+#endif
 
 #ifdef NEW_LOGGING
                        LDAP_LOG(( "connection", LDAP_LEVEL_ERR,