sock.sin_family = AF_INET;
sock.sin_port = 0;
if ( bind(s, (struct sockaddr *) &sock, sizeof(sock)) < 0) {
- close( s );
+ tcp_close( s );
return( NULL );
}
if (( ld = ldap_init( host, port )) == NULL ) {
- close( s );
+ tcp_close( s );
return( NULL );
}
ld->ld_cldapnaddr = 0;
ld->ld_cldapaddrs = NULL;
- if (lber_pvt_sb_set_io( &(ld->ld_sb), &lber_pvt_sb_io_udp, NULL )<0) {
+ if (ber_pvt_sb_set_io( &(ld->ld_sb), &ber_pvt_sb_io_udp, NULL )<0) {
ldap_ld_free(ld, 1 );
return NULL;
}
}
if ( ld->ld_cldapaddrs == NULL
-#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS
|| ( ld->ld_defconn = ldap_new_connection( ld, NULL, 1,0,0 )) == NULL
-#endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS */
) {
ldap_ld_free( ld, 0 );
DO_RETURN( NULL );
}
- lber_pvt_sb_udp_set_dst( &ld->ld_sb, ld->ld_cldapaddrs[0] );
+ ber_pvt_sb_udp_set_dst( &ld->ld_sb, ld->ld_cldapaddrs[0] );
cldap_setretryinfo( ld, 0, 0 );
--ld->ld_msgid; /* use same id as before */
}
- lber_pvt_sb_udp_set_dst( &(ld->ld_sb),
+ ber_pvt_sb_udp_set_dst( &(ld->ld_sb),
ld->ld_cldapaddrs[ cri.cri_useaddr ] );
Debug( LDAP_DEBUG_TRACE, "cldap_search_s try %d (to %s)\n",
* got a result: determine which server it came from
* decode into ldap message chain
*/
- src = (struct sockaddr_in *) lber_pvt_sb_udp_get_src( sb );
+ src = (struct sockaddr_in *) ber_pvt_sb_udp_get_src( sb );
for ( fromaddr = 0; fromaddr < ld->ld_cldapnaddr; ++fromaddr ) {
if ( memcmp( &((struct sockaddr_in *)
if ( i == fromaddr ) {
continue;
}
- lber_pvt_sb_udp_set_dst( sb, ld->ld_cldapaddrs[i] );
+ ber_pvt_sb_udp_set_dst( sb, ld->ld_cldapaddrs[i] );
Debug( LDAP_DEBUG_TRACE, "cldap_result abandoning id %d (to %s)\n",
msgid, inet_ntoa( ((struct sockaddr_in *)
if ( ldap_debug & LDAP_DEBUG_PACKETS ) {
fprintf( stderr, "cldap_parsemsg add message id %d type %d:\n",
ldm->lm_msgid, ldm->lm_msgtype );
- lber_log_dump( LDAP_DEBUG_BER, ldap_debug, ldm->lm_ber, 1 );
+ ber_log_dump( LDAP_DEBUG_BER, ldap_debug, ldm->lm_ber, 1 );
}
#endif /* LDAP_DEBUG */