From: Howard Chu Date: Mon, 19 May 2003 10:33:18 +0000 (+0000) Subject: ITS#2490 - allow retry for incomplete reads of BER tag & len X-Git-Tag: OPENLDAP_REL_ENG_2_2_0ALPHA~111 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9757665aed90c0d2bb4cbc2941a5456b8bbdb773;p=openldap ITS#2490 - allow retry for incomplete reads of BER tag & len --- diff --git a/libraries/liblber/io.c b/libraries/liblber/io.c index 921363177b..bab1fbe91c 100644 --- a/libraries/liblber/io.c +++ b/libraries/liblber/io.c @@ -543,10 +543,10 @@ ber_get_next( return LBER_DEFAULT; } } + if (sblen == 1) continue; + ber->ber_tag = tag; ber->ber_ptr = (char *)p; - - if (sblen == 1) continue; } /* Now look for the length */ @@ -559,6 +559,11 @@ ber_get_next( } /* Not enough bytes? */ if (ber->ber_rwptr - ber->ber_ptr < llen) { +#if defined( EWOULDBLOCK ) + errno = EWOULDBLOCK; +#elif defined( EAGAIN ) + errno = EAGAIN; +#endif return LBER_DEFAULT; } for (i=0;