From: Pierangelo Masarati Date: Sat, 5 Jan 2002 17:16:18 +0000 (+0000) Subject: meaningful message in case max_incomingis hit X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~274 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1cf91cd6dbf3b2a1a1eef569288d6405ac4ab5ca;p=openldap meaningful message in case max_incomingis hit --- diff --git a/libraries/liblber/io.c b/libraries/liblber/io.c index 068661c255..578f42be09 100644 --- a/libraries/liblber/io.c +++ b/libraries/liblber/io.c @@ -576,9 +576,19 @@ fill_buffer: /* now fill the buffer. */ /* make sure length is reasonable */ - if ( ber->ber_len == 0 || - ( sb->sb_max_incoming && ber->ber_len > sb->sb_max_incoming )) - { + if ( ber->ber_len == 0 ) { + errno = ERANGE; + return LBER_DEFAULT; + } else if ( sb->sb_max_incoming && ber->ber_len > sb->sb_max_incoming ) { +#ifdef NEW_LOGGING + LDAP_LOG(( "liblber", LDAP_LEVEL_ERR, + "ber_get_next: sockbuf_max_incoming limit hit " + "(%d > %d)\n", ber->ber_len, sb->sb_max_incoming )); +#else + ber_log_printf( LDAP_DEBUG_CONNS, ber->ber_debug, + "ber_get_next: sockbuf_max_incoming limit hit " + "(%ld > %ld)\n", ber->ber_len, sb->sb_max_incoming ); +#endif errno = ERANGE; return LBER_DEFAULT; }