From: Kurt Zeilenga Date: Fri, 26 May 2000 01:23:47 +0000 (+0000) Subject: ITS#533: simplify ber_next_read X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~2858 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=14973373355e687a4b32dd111ec07a0296006f66;p=openldap ITS#533: simplify ber_next_read --- diff --git a/libraries/liblber/io.c b/libraries/liblber/io.c index 7154d3480c..a31d23daf5 100644 --- a/libraries/liblber/io.c +++ b/libraries/liblber/io.c @@ -475,7 +475,7 @@ get_tag( Sockbuf *sb ) /* * A rewrite of ber_get_next that can safely be called multiple times - * for the same packet. It will simply continue were it stopped until + * for the same packet. It will simply continue where it stopped until * a full packet is read. */ @@ -575,27 +575,17 @@ get_lenbyte: to_go = (char *) &ber->ber_len + sizeof( ber->ber_len ) - ber->ber_rwptr; assert( to_go > 0 ); - res = ber_pvt_sb_read( sb, netlen, to_go ); + res = BerRead( sb, netlen, to_go ); if (res <= 0) { return LBER_DEFAULT; } ber->ber_rwptr += res; - if (res==to_go) { - /* convert length. */ - ber->ber_len = 0; - for( to_go = 0; to_go < res ; to_go++ ) { - ber->ber_len <<= 8; - ber->ber_len |= netlen[to_go]; - } - goto fill_buffer; - } else { -#if defined( EWOULDBLOCK ) - errno = EWOULDBLOCK; -#elif defined( EAGAIN ) - errno = EAGAIN; -#endif - return LBER_DEFAULT; + /* convert length. */ + ber->ber_len = 0; + for( to_go = 0; to_go < res ; to_go++ ) { + ber->ber_len <<= 8; + ber->ber_len |= netlen[to_go]; } }