]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/open.c
Added LDAP_LOG messages
[openldap] / libraries / libldap / open.c
index 344df988f053a451e55e6ab345fa4eb265004acb..244dde7317c1008b69688591543c6c012d070444 100644 (file)
@@ -1,6 +1,6 @@
 /* $OpenLDAP$ */
 /*
- * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 /*  Portions
@@ -239,6 +239,14 @@ ldap_int_open_connection(
                                host = srv->lud_host;
                        }
 
+                       if( !port ) {
+                               if( strcmp(srv->lud_scheme, "ldaps") == 0 ) {
+                                       port = LDAPS_PORT;
+                               } else {
+                                       port = LDAP_PORT;
+                               }
+                       }
+
                        rc = ldap_connect_to_host( ld, conn->lconn_sb,
                                proto, host, addr, port, async );
 
@@ -256,6 +264,7 @@ ldap_int_open_connection(
 #endif
                        break;
 #ifdef LDAP_CONNECTIONLESS
+
                case LDAP_PROTO_UDP:
                        port = srv->lud_port;
 
@@ -266,6 +275,9 @@ ldap_int_open_connection(
                        } else {
                                host = srv->lud_host;
                        }
+
+                       if( !port ) port = LDAP_PORT;
+
                        LDAP_IS_UDP(ld) = 1;
                        rc = ldap_connect_to_host( ld, conn->lconn_sb,
                                proto, host, addr, port, async );