]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/request.c
Silence warning in print_deref(): cast lutil_b64_ntop() arg to unsigned char*
[openldap] / libraries / libldap / request.c
index a7784771dc22c9234775e3d5b103ea0f49f89d5e..6098f0c904b14c48389c189c55252c6f0ff78dc2 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2008 The OpenLDAP Foundation.
+ * Copyright 1998-2009 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -452,9 +452,9 @@ ldap_new_connection( LDAP *ld, LDAPURLDesc **srvlist, int use_ldsb,
        ldap_pvt_thread_mutex_unlock( &ld->ld_conn_mutex );
 #endif
 
-       if ( lc->lconn_server->lud_exts ) {
+       if ( connect ) {
 #ifdef HAVE_TLS
-               if ( connect ) {
+               if ( lc->lconn_server->lud_exts ) {
                        int rc, ext = find_tls_ext( lc->lconn_server );
                        if ( ext ) {
                                LDAPConn        *savedefconn;
@@ -480,7 +480,6 @@ ldap_new_connection( LDAP *ld, LDAPURLDesc **srvlist, int use_ldsb,
                                        return NULL;
                                }
                        }
-                       
                }
 #endif
        }
@@ -636,8 +635,7 @@ find_connection( LDAP *ld, LDAPURLDesc *srv, int any )
 
                        if ( lsu_port == lcu_port
                                && strcmp( lcu->lud_scheme, lsu->lud_scheme ) == 0
-                               && lcu->lud_host != NULL && *lcu->lud_host != '\0'
-                               && lsu->lud_host != NULL && *lsu->lud_host != '\0'
+                               && lcu->lud_host != NULL && lsu->lud_host != NULL
                                && strcasecmp( lsu->lud_host, lcu->lud_host ) == 0 )
                        {
                                found = 1;
@@ -736,6 +734,9 @@ ldap_free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind )
                }
 
                ldap_int_sasl_close( ld, lc );
+#ifdef HAVE_GSSAPI
+               ldap_int_gssapi_close( ld, lc );
+#endif
 
                ldap_free_urllist( lc->lconn_server );
 
@@ -1096,7 +1097,7 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, int sref, char *
                        /* See if we've already requested this DN with this conn */
                        LDAPRequest *lp;
                        int looped = 0;
-                       int len = srv->lud_dn ? strlen( srv->lud_dn ) : 0;
+                       ber_len_t len = srv->lud_dn ? strlen( srv->lud_dn ) : 0;
                        for ( lp = origreq; lp; ) {
                                if ( lp->lr_conn == lc
                                        && len == lp->lr_dn.bv_len
@@ -1355,7 +1356,7 @@ ldap_chase_referrals( LDAP *ld,
                if (( lc = find_connection( ld, srv, 1 )) != NULL ) {
                        LDAPRequest *lp;
                        int looped = 0;
-                       int len = srv->lud_dn ? strlen( srv->lud_dn ) : 0;
+                       ber_len_t len = srv->lud_dn ? strlen( srv->lud_dn ) : 0;
                        for ( lp = lr; lp; lp = lp->lr_parent ) {
                                if ( lp->lr_conn == lc
                                        && len == lp->lr_dn.bv_len )