]> git.sur5r.net Git - openldap/commitdiff
Cleanup (not)found logic
authorKurt Zeilenga <kurt@openldap.org>
Thu, 3 Jan 2002 08:03:22 +0000 (08:03 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Thu, 3 Jan 2002 08:03:22 +0000 (08:03 +0000)
servers/slapd/abandon.c

index 30ba6af812e06692cf5d75a9dc314cfa9d224a1e..7da48204e7b88cc1ce91cc278dfe149d708c0fba 100644 (file)
@@ -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;
 }