X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Fopen.c;h=244dde7317c1008b69688591543c6c012d070444;hb=a299e74d2155a1a660db00ca7eb184b4e98edd1a;hp=344df988f053a451e55e6ab345fa4eb265004acb;hpb=06b350c04c040aa0ba4932166d420a7b107b24ba;p=openldap diff --git a/libraries/libldap/open.c b/libraries/libldap/open.c index 344df988f0..244dde7317 100644 --- a/libraries/libldap/open.c +++ b/libraries/libldap/open.c @@ -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 );