X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Fopen.c;h=1bc86e39a718d160eee2a8f03180bb135328b5c7;hb=a5cad3f18a4b8fbbbb1bfc5db9d00022d9ebbfc4;hp=cda6e86423ad7fd766fb8bffb9187dfe8bfb78c6;hpb=3f04d776155a14bc03d7a0b9bcaabcd385f9dba3;p=openldap diff --git a/libraries/libldap/open.c b/libraries/libldap/open.c index cda6e86423..1bc86e39a7 100644 --- a/libraries/libldap/open.c +++ b/libraries/libldap/open.c @@ -1,7 +1,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1998-2008 The OpenLDAP Foundation. + * Copyright 1998-2010 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -271,6 +271,8 @@ ldap_init_fd( ldap_unbind_ext( ld, NULL, NULL ); return( LDAP_NO_MEMORY ); } + if( url ) + conn->lconn_server = ldap_url_dup( ld->ld_options.ldo_defludp ); ber_sockbuf_ctrl( conn->lconn_sb, LBER_SB_OPT_SET_FD, &fd ); ld->ld_defconn = conn; ++ld->ld_defconn->lconn_refcnt; /* so it never gets closed/freed */ @@ -337,8 +339,7 @@ ldap_int_open_connection( int async ) { int rc = -1; - char *host; - int port, proto; + int proto; Debug( LDAP_DEBUG_TRACE, "ldap_int_open_connection\n", 0, 0, 0 );