X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Fos-ip.c;h=0084743d8498fe922a32e9aade7835416abbe656;hb=70092b38fb23b9141a2b8414fb5a9c5200f3c12d;hp=396873459726dee61288383c461611e62bd9487e;hpb=dffb050d81c4ca9c6477b349b4b0f3c5c72b9c7c;p=openldap diff --git a/libraries/libldap/os-ip.c b/libraries/libldap/os-ip.c index 3968734597..0084743d84 100644 --- a/libraries/libldap/os-ip.c +++ b/libraries/libldap/os-ip.c @@ -152,7 +152,7 @@ ldap_pvt_is_socket_ready(LDAP *ld, int s) #if defined( notyet ) /* && defined( SO_ERROR ) */ { int so_errno; - int dummy = sizeof(so_errno); + socklen_t dummy = sizeof(so_errno); if ( getsockopt( s, SOL_SOCKET, SO_ERROR, &so_errno, &dummy ) == AC_SOCKET_ERROR ) { @@ -170,7 +170,7 @@ ldap_pvt_is_socket_ready(LDAP *ld, int s) /* error slippery */ struct sockaddr_in sin; char ch; - int dummy = sizeof(sin); + socklen_t dummy = sizeof(sin); if ( getpeername( s, (struct sockaddr *) &sin, &dummy ) == AC_SOCKET_ERROR ) { @@ -318,13 +318,18 @@ ldap_connect_to_host(LDAP *ld, Sockbuf *sb, char *ha_buf=NULL, *p, *q; int socktype; - osip_debug(ld, "ldap_connect_to_host: %s\n",host,0,0); switch(proto) { - case LDAP_PROTO_TCP: socktype = SOCK_STREAM; break; - case LDAP_PROTO_UDP: socktype = SOCK_DGRAM; break; - default: osip_debug(ld, "ldap_connect_to_host: unknown proto: %d\n", - proto, 0, 0); + case LDAP_PROTO_TCP: socktype = SOCK_STREAM; + osip_debug(ld, "ldap_connect_to_host: TCP %s:%d\n",host,port,0); + break; + case LDAP_PROTO_UDP: socktype = SOCK_DGRAM; + osip_debug(ld, "ldap_connect_to_host: TCP %s:%d\n",host,port,0); + break; + + default: + osip_debug(ld, "ldap_connect_to_host: unknown proto: %d\n", + proto, 0, 0); return -1; } @@ -339,7 +344,7 @@ ldap_connect_to_host(LDAP *ld, Sockbuf *sb, hints.ai_socktype = socktype; snprintf(serv, sizeof serv, "%d", port ); - if ( err = getaddrinfo(host, serv, &hints, &res) ) { + if ( ( err = getaddrinfo(host, serv, &hints, &res) ) ) { osip_debug(ld, "ldap_connect_to_host: getaddrinfo failed: %s\n", AC_GAI_STRERROR(err), 0, 0); return -1; @@ -676,7 +681,11 @@ ldap_int_select( LDAP *ld, struct timeval *timeout ) { struct selectinfo *sip; +#ifdef NEW_LOGGING + LDAP_LOG (( "os-ip", LDAP_LEVEL_ENTRY, "ldap_int_select\n" )); +#else Debug( LDAP_DEBUG_TRACE, "ldap_int_select\n", 0, 0, 0 ); +#endif if ( ldap_int_tblsize == 0 ) ldap_int_ip_init();