From a42367ae3a8a2254f59aa079334ec62048063f5a Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Mon, 24 Apr 2006 17:20:13 +0000 Subject: [PATCH] cleanup --- libraries/libldap/result.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c index 83b2e7eed1..04e5fdb96a 100644 --- a/libraries/libldap/result.c +++ b/libraries/libldap/result.c @@ -458,28 +458,30 @@ retry: nextresp3: #endif tag = ber_get_next( lc->lconn_sb, &len, ber ); - if ( tag == LDAP_TAG_MESSAGE ) { + switch ( tag ) { + case LDAP_TAG_MESSAGE: /* * We read a complete message. * The connection should no longer need this ber. */ lc->lconn_ber = NULL; - } - if ( tag != LDAP_TAG_MESSAGE ) { - if ( tag == LBER_DEFAULT) { + break; + + case LBER_DEFAULT: #ifdef LDAP_DEBUG - Debug( LDAP_DEBUG_CONNS, - "ber_get_next failed.\n", 0, 0, 0 ); + Debug( LDAP_DEBUG_CONNS, + "ber_get_next failed.\n", 0, 0, 0 ); #endif #ifdef EWOULDBLOCK - if (errno==EWOULDBLOCK) return LDAP_MSG_X_KEEP_LOOKING; + if ( errno == EWOULDBLOCK ) return LDAP_MSG_X_KEEP_LOOKING; #endif #ifdef EAGAIN - if (errno == EAGAIN) return LDAP_MSG_X_KEEP_LOOKING; + if ( errno == EAGAIN ) return LDAP_MSG_X_KEEP_LOOKING; #endif - ld->ld_errno = LDAP_SERVER_DOWN; - return -1; - } + ld->ld_errno = LDAP_SERVER_DOWN; + return -1; + + default: ld->ld_errno = LDAP_LOCAL_ERROR; return -1; } @@ -793,7 +795,8 @@ lr->lr_res_matched ? lr->lr_res_matched : "" ); ber_free( ber, 1 ); ber = NULL; if ( build_result_ber( ld, &ber, lr ) - == LBER_ERROR ) { + == LBER_ERROR ) + { rc = -1; /* fatal error */ } } -- 2.39.5