mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-02-18 10:07:56 -05:00
Handle timeouts from ldap_result()
This commit is contained in:
parent
5f1fdfa515
commit
b984564dbd
11 changed files with 11 additions and 11 deletions
|
|
@ -208,7 +208,7 @@ ldap_add_ext_s(
|
|||
if ( rc != LDAP_SUCCESS )
|
||||
return( rc );
|
||||
|
||||
if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 )
|
||||
if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 || !res )
|
||||
return( ld->ld_errno );
|
||||
|
||||
return( ldap_result2error( ld, res, 1 ) );
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ ldap_compare_ext_s(
|
|||
if ( rc != LDAP_SUCCESS )
|
||||
return( rc );
|
||||
|
||||
if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 )
|
||||
if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 || !res )
|
||||
return( ld->ld_errno );
|
||||
|
||||
return( ldap_result2error( ld, res, 1 ) );
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ ldap_refresh_s(
|
|||
if ( rc != LDAP_SUCCESS ) return rc;
|
||||
|
||||
rc = ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *)NULL, &res );
|
||||
if( rc == -1 ) return ld->ld_errno;
|
||||
if( rc == -1 || !res ) return ld->ld_errno;
|
||||
|
||||
rc = ldap_parse_refresh( ld, res, newttl );
|
||||
if( rc != LDAP_SUCCESS ) {
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ ldap_delete_ext_s(
|
|||
if( rc != LDAP_SUCCESS )
|
||||
return( ld->ld_errno );
|
||||
|
||||
if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 )
|
||||
if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 || !res )
|
||||
return( ld->ld_errno );
|
||||
|
||||
return( ldap_result2error( ld, res, 1 ) );
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ ldap_extended_operation_s(
|
|||
return( rc );
|
||||
}
|
||||
|
||||
if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 ) {
|
||||
if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 || !res ) {
|
||||
return( ld->ld_errno );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ ldap_modify_ext_s( LDAP *ld, LDAP_CONST char *dn,
|
|||
if ( rc != LDAP_SUCCESS )
|
||||
return( rc );
|
||||
|
||||
if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 )
|
||||
if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 || !res )
|
||||
return( ld->ld_errno );
|
||||
|
||||
return( ldap_result2error( ld, res, 1 ) );
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ ldap_rename_s(
|
|||
|
||||
rc = ldap_result( ld, msgid, LDAP_MSG_ALL, NULL, &res );
|
||||
|
||||
if( rc == -1 ) {
|
||||
if( rc == -1 || !res ) {
|
||||
return ld->ld_errno;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ ldap_passwd_s(
|
|||
return rc;
|
||||
}
|
||||
|
||||
if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 ) {
|
||||
if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 || !res ) {
|
||||
return ld->ld_errno;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ ldap_sasl_bind_s(
|
|||
}
|
||||
#endif
|
||||
|
||||
if ( ldap_result( ld, msgid, LDAP_MSG_ALL, NULL, &result ) == -1 ) {
|
||||
if ( ldap_result( ld, msgid, LDAP_MSG_ALL, NULL, &result ) == -1 || !result ) {
|
||||
return( ld->ld_errno ); /* ldap_result sets ld_errno */
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -385,7 +385,7 @@ ldap_search_s(
|
|||
== -1 )
|
||||
return( ld->ld_errno );
|
||||
|
||||
if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, res ) == -1 )
|
||||
if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, res ) == -1 || !res )
|
||||
return( ld->ld_errno );
|
||||
|
||||
return( ldap_result2error( ld, *res, 0 ) );
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ ldap_whoami_s(
|
|||
rc = ldap_whoami( ld, sctrls, cctrls, &msgid );
|
||||
if ( rc != LDAP_SUCCESS ) return rc;
|
||||
|
||||
if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 ) {
|
||||
if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 || !res ) {
|
||||
return ld->ld_errno;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue