X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Fresult.c;h=05580b793cfa8215566cb412215f35021927bf8b;hb=a5cad3f18a4b8fbbbb1bfc5db9d00022d9ebbfc4;hp=afdc236ea7eb2d20e624f4bacddb86696e01c960;hpb=7b900b07c7aca6b466d59961c655c6f7d547af1b;p=openldap diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c index afdc236ea7..05580b793c 100644 --- a/libraries/libldap/result.c +++ b/libraries/libldap/result.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1998-2009 The OpenLDAP Foundation. + * Copyright 1998-2010 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -276,7 +276,7 @@ wait4msg( } #endif /* LDAP_DEBUG */ - if ( timeout != NULL ) { + if ( timeout != NULL && timeout->tv_sec != -1 ) { tv0 = *timeout; tv = *timeout; tvp = &tv; @@ -747,8 +747,9 @@ nextresp2: } /* Do we need to check for referrals? */ - if ( LDAP_BOOL_GET(&ld->ld_options, LDAP_BOOL_REFERRALS) || - lr->lr_parent != NULL ) + if ( tag != LDAP_RES_BIND && + ( LDAP_BOOL_GET(&ld->ld_options, LDAP_BOOL_REFERRALS) || + lr->lr_parent != NULL )) { char **refs = NULL; ber_len_t len; @@ -993,6 +994,7 @@ nextresp2: /* need to return -1, because otherwise * a valid result is expected */ + ld->ld_errno = lderr; return -1; } }