X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fconnection.c;h=eaccc9cfa9df795041ae3375631aa8531ee265ad;hb=ed471a4d53b9bcd2cc89410743ffb4bd58b5fc05;hp=8d626aee5697553fea8b7eda9c427cfb1878aa0b;hpb=956f1d16aa522da6f6506d9c8fe9ce0d9867678a;p=openldap diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index 8d626aee56..eaccc9cfa9 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -395,22 +395,28 @@ long connection_init( if( c == NULL ) { #ifdef NEW_LOGGING LDAP_LOG( CONNECTION, INFO, - "connection_init: skt %d connection table full (%d/%d)\n", - s, i, dtblsize ); + "connection_init: skt %d connection table full " + "(%d/%d)\n", s, i, dtblsize ); #else Debug( LDAP_DEBUG_ANY, - "connection_init(%d): connection table full (%d/%d)\n", - s, i, dtblsize); + "connection_init(%d): connection table full " + "(%d/%d)\n", s, i, dtblsize); #endif ldap_pvt_thread_mutex_unlock( &connections_mutex ); return -1; } - } + } #endif - assert( c != NULL ); + assert( c != NULL ); if( c->c_struct_state == SLAP_C_UNINITIALIZED ) { + c->c_send_ldap_result = slap_send_ldap_result; + c->c_send_search_entry = slap_send_search_entry; + c->c_send_search_result = slap_send_search_result; + c->c_send_search_reference = slap_send_search_reference; + c->c_send_ldap_extended = slap_send_ldap_extended; + c->c_authmech.bv_val = NULL; c->c_authmech.bv_len = 0; c->c_dn.bv_val = NULL; @@ -635,22 +641,6 @@ connection_destroy( Connection *c ) } c->c_peer_domain.bv_len = 0; if(c->c_peer_name.bv_val != NULL) { -#ifdef LDAP_PF_LOCAL - /* - * If peer was a domain socket, unlink. Mind you, - * they may be un-named. Should we leave this to - * the client? - */ - if (strncmp(c->c_peer_name.bv_val, "PATH=", - sizeof("PATH=") - 1) == 0) { - char *path = c->c_peer_name.bv_val - + sizeof("PATH=") - 1; - if (path[0] != '\0') { - (void)unlink(path); - } - } -#endif /* LDAP_PF_LOCAL */ - free(c->c_peer_name.bv_val); c->c_peer_name.bv_val = NULL; } @@ -1041,7 +1031,12 @@ operations_error: LDAP_STAILQ_REMOVE( &conn->c_ops, arg->co_op, slap_op, o_next); LDAP_STAILQ_NEXT(arg->co_op, o_next) = NULL; - slap_op_free( arg->co_op ); +#ifdef LDAP_CLIENT_UPDATE + if ( !( arg->co_op->o_clientupdate_type & SLAP_LCUP_PERSIST ) ) +#endif /* LDAP_CLIENT_UPDATE */ + { + slap_op_free( arg->co_op ); + } arg->co_op = NULL; arg->co_conn = NULL; free( (char *) arg ); @@ -1233,16 +1228,20 @@ int connection_read(ber_socket_t s) #endif #define CONNECTION_INPUT_LOOP 1 +/* #define DATA_READY_LOOP 1 */ -#ifdef DATA_READY_LOOP - while( !rc && ber_sockbuf_ctrl( c->c_sb, LBER_SB_DATA_READY, NULL ) ) -#elif CONNECTION_INPUT_LOOP - while(!rc) -#endif + do { /* How do we do this without getting into a busy loop ? */ rc = connection_input( c ); } +#ifdef DATA_READY_LOOP + while( !rc && ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_DATA_READY, NULL ) ); +#elif CONNECTION_INPUT_LOOP + while(!rc); +#else + while(0); +#endif if( rc < 0 ) { #ifdef NEW_LOGGING