]> git.sur5r.net Git - openldap/commitdiff
improve previous commit
authorPierangelo Masarati <ando@openldap.org>
Sun, 14 May 2006 17:53:40 +0000 (17:53 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sun, 14 May 2006 17:53:40 +0000 (17:53 +0000)
servers/slapd/back-ldap/bind.c

index 9ed0cb3e1f62dde134495a5f3bd0c18378537e73..51fd064dcad0e7a519ffee30bf2c741274177574 100644 (file)
 
 #define LDAP_CONTROL_OBSOLETE_PROXY_AUTHZ      "2.16.840.1.113730.3.4.12"
 
+#if PRINT_CONNTREE > 0
+static void
+ravl_print( Avlnode *root, int depth )
+{
+       int             i;
+       ldapconn_t      *lc;
+       
+       if ( root == 0 ) {
+               return;
+       }
+       
+       ravl_print( root->avl_right, depth+1 );
+       
+       for ( i = 0; i < depth; i++ ) {
+               fprintf( stderr, "-" );
+       }
+
+       lc = root->avl_data;
+       fprintf( stderr, "lc=%p local=\"%s\" conn=%p %s refcnt=%d\n",
+               (void *)lc, lc->lc_local_ndn.bv_val, (void *)lc->lc_conn,
+               avl_bf2str( root->avl_bf ), lc->lc_refcnt );
+       
+       ravl_print( root->avl_left, depth+1 );
+}
+
+static void
+myprint( Avlnode *root, char *msg )
+{
+       fprintf( stderr, "========> %s\n", msg );
+       
+       if ( root == 0 ) {
+               fprintf( stderr, "\tNULL\n" );
+
+       } else {
+               ravl_print( root, 0 );
+       }
+       
+       fprintf( stderr, "<======== %s\n", msg );
+}
+#endif /* PRINT_CONNTREE */
+
 static int
 ldap_back_proxy_authz_bind( ldapconn_t *lc, Operation *op, SlapReply *rs, ldap_back_send_t sendok );
 
@@ -158,6 +199,10 @@ retry_lock:;
                                ldap_back_conndn_cmp, ldap_back_conndn_dup );
                }
 
+#if PRINT_CONNTREE > 0
+               myprint( li->li_conninfo.lai_tree, "ldap_back_bind" );
+#endif /* PRINT_CONNTREE */
+       
                ldap_pvt_thread_mutex_unlock( &li->li_conninfo.lai_mutex );
                switch ( lerr ) {
                case 0:
@@ -274,47 +319,6 @@ ldap_back_conndn_dup( void *c1, void *c2 )
        return 0;
 }
 
-#if PRINT_CONNTREE > 0
-static void
-ravl_print( Avlnode *root, int depth )
-{
-       int             i;
-       ldapconn_t      *lc;
-       
-       if ( root == 0 ) {
-               return;
-       }
-       
-       ravl_print( root->avl_right, depth+1 );
-       
-       for ( i = 0; i < depth; i++ ) {
-               fprintf( stderr, "-" );
-       }
-
-       lc = root->avl_data;
-       fprintf( stderr, "lc=%p local=\"%s\" conn=%p %s refcnt=%d\n",
-               (void *)lc, lc->lc_local_ndn.bv_val, (void *)lc->lc_conn,
-               avl_bf2str( root->avl_bf ), lc->lc_refcnt );
-       
-       ravl_print( root->avl_left, depth+1 );
-}
-
-static void
-myprint( Avlnode *root )
-{
-       fprintf( stderr, "========>\n" );
-       
-       if ( root == 0 ) {
-               fprintf( stderr, "\tNULL\n" );
-
-       } else {
-               ravl_print( root, 0 );
-       }
-       
-       fprintf( stderr, "<========\n" );
-}
-#endif /* PRINT_CONNTREE */
-
 int
 ldap_back_freeconn( Operation *op, ldapconn_t *lc, int dolock )
 {
@@ -696,7 +700,7 @@ retry_lock:
                        ldap_back_conndn_cmp, ldap_back_conndn_dup );
 
 #if PRINT_CONNTREE > 0
-               myprint( li->li_conninfo.lai_tree );
+               myprint( li->li_conninfo.lai_tree, "ldap_back_getconn" );
 #endif /* PRINT_CONNTREE */
        
                ldap_pvt_thread_mutex_unlock( &li->li_conninfo.lai_mutex );