X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Fresult.c;h=e517a059ab23a8348741ff47208b468ddc2e988f;hb=df8f7cbb9b79be3be9205d116d1dd0b263d6861a;hp=adc34d9db4159ff1c50cce4e7d4de66e7aeceeaf;hpb=669b8f4047c03d4583a44ed8287d0d5920d15373;p=openldap diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c index adc34d9db4..e517a059ab 100644 --- a/libraries/libldap/result.c +++ b/libraries/libldap/result.c @@ -61,7 +61,11 @@ static void merge_error_info LDAP_P(( LDAP *ld, LDAPRequest *parentr, LDAPReques * ldap_result( s, msgid, all, timeout, result ) */ int -ldap_result( LDAP *ld, int msgid, int all, struct timeval *timeout, +ldap_result( + LDAP *ld, + int msgid, + int all, + struct timeval *timeout, LDAPMessage **result ) { LDAPMessage *lm, *lastlm, *nextlm; @@ -121,8 +125,7 @@ ldap_result( LDAP *ld, int msgid, int all, struct timeval *timeout, } if ( tmp == NULL ) { - return( wait4msg( ld, msgid, all, timeout, - result ) ); + lm = NULL; } break; @@ -759,7 +762,14 @@ cldap_getmsg( LDAP *ld, struct timeval *timeout, BerElement *ber ) ber_len_t len; if ( ! ber_pvt_sb_data_ready(&ld->ld_sb) ) { - rc = ldap_select1( ld, timeout ); + /* restored from ldap_select1() in result.c version 1.24 */ + fd_set readfds; + if ( ldap_int_tblsize == 0 ) + ldap_int_ip_init(); + FD_ZERO( &readfds ); + FD_SET( ber_pvt_sb_get_desc(&ld->ld_sb), &readfds ); + rc = select( ldap_int_tblsize, &readfds, 0, 0, timeout ); + if ( rc == -1 || rc == 0 ) { ld->ld_errno = (rc == -1 ? LDAP_SERVER_DOWN : LDAP_TIMEOUT);