ITS#2490 - more retry checks

This commit is contained in:
Howard Chu 2003-05-19 10:37:09 +00:00
parent 9757665aed
commit 5eb0ec070c
2 changed files with 14 additions and 4 deletions

View File

@ -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",

View File

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