Handle timeouts from ldap_result()

This commit is contained in:
Howard Chu 2007-02-05 12:30:40 +00:00
parent 5f1fdfa515
commit b984564dbd
11 changed files with 11 additions and 11 deletions

View file

@ -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 ) );

View file

@ -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 ) );

View file

@ -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 ) {

View file

@ -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 ) );

View file

@ -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 );
}

View file

@ -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 ) );

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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 */
}

View file

@ -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 ) );

View file

@ -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;
}