From 1cf91cd6dbf3b2a1a1eef569288d6405ac4ab5ca Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sat, 5 Jan 2002 17:16:18 +0000 Subject: [PATCH] meaningful message in case max_incomingis hit --- libraries/liblber/io.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) 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; } -- 2.39.5