mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-27 03:20:22 +08:00
ITS#2490 - more retry checks
This commit is contained in:
parent
9757665aed
commit
5eb0ec070c
@ -24,6 +24,7 @@
|
||||
#include <ac/string.h>
|
||||
#include <ac/socket.h>
|
||||
#include <ac/unistd.h>
|
||||
#include <ac/errno.h>
|
||||
|
||||
#ifdef HAVE_CONSOLE_H
|
||||
#include <console.h>
|
||||
@ -73,10 +74,14 @@ main( int argc, char **argv )
|
||||
return( EXIT_FAILURE );
|
||||
}
|
||||
|
||||
tag = ber_get_next( sb, &len, ber);
|
||||
if( tag == LBER_ERROR ) {
|
||||
perror( "ber_get_next" );
|
||||
return( EXIT_FAILURE );
|
||||
for (;;) {
|
||||
tag = ber_get_next( sb, &len, ber);
|
||||
if( tag == LBER_ERROR ) {
|
||||
if( errno == EWOULDBLOCK ) continue;
|
||||
if( errno == EAGAIN ) continue;
|
||||
perror( "ber_get_next" );
|
||||
return( EXIT_FAILURE );
|
||||
}
|
||||
}
|
||||
|
||||
printf("decode: message tag 0x%lx and length %ld\n",
|
||||
|
@ -540,6 +540,11 @@ ber_get_next(
|
||||
}
|
||||
/* Did we run out of bytes? */
|
||||
if ((char *)p == ber->ber_rwptr) {
|
||||
#if defined( EWOULDBLOCK )
|
||||
errno = EWOULDBLOCK;
|
||||
#elif defined( EAGAIN )
|
||||
errno = EAGAIN;
|
||||
#endif
|
||||
return LBER_DEFAULT;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user