From: Kurt Zeilenga Date: Thu, 3 Jan 2002 08:03:22 +0000 (+0000) Subject: Cleanup (not)found logic X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~320 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=33e6f6e65c931039f345730ecfc32585114f13c3;p=openldap Cleanup (not)found logic --- diff --git a/servers/slapd/abandon.c b/servers/slapd/abandon.c index 30ba6af812..7da48204e7 100644 --- a/servers/slapd/abandon.c +++ b/servers/slapd/abandon.c @@ -83,7 +83,6 @@ do_abandon( return LDAP_SUCCESS; } - notfound = 1; /* not found */ ldap_pvt_thread_mutex_lock( &conn->c_mutex ); /* * find the operation being abandoned and set the o_abandon @@ -96,21 +95,16 @@ do_abandon( ldap_pvt_thread_mutex_lock( &o->o_abandonmutex ); o->o_abandon = 1; ldap_pvt_thread_mutex_unlock( &o->o_abandonmutex ); - - notfound = 0; goto done; } } LDAP_STAILQ_FOREACH( o, &conn->c_pending_ops, o_next ) { - if ( o->o_msgid == id ) - break; - } - - if( o != NULL ) { - LDAP_STAILQ_REMOVE( &conn->c_pending_ops, o, slap_op, o_next ); - slap_op_free( o ); - notfound = 0; + if ( o->o_msgid == id ) { + LDAP_STAILQ_REMOVE( &conn->c_pending_ops, o, slap_op, o_next ); + slap_op_free( o ); + goto done; + } } done: @@ -119,10 +113,10 @@ done: #ifdef NEW_LOGGING LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY, "do_abandon: conn: %d op=%ld %sfound\n", - conn->c_connid, (long)id, notfound ? "not " : "" )); + conn->c_connid, (long)id, o ? "" : "not " )); #else Debug( LDAP_DEBUG_TRACE, "do_abandon: op=%ld %sfound\n", - (long) id, notfound ? "not " : "", 0 ); + (long) id, o ? "" : "not ", 0 ); #endif return LDAP_SUCCESS; }