]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/cancel.c
Another abandon check
[openldap] / servers / slapd / cancel.c
index 5dcea54114b41d70200845d59e5d0d1fcbd2db9b..12dfabb3fead793675b53e96dac05d4eb0a6b457 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2003 The OpenLDAP Foundation.
+ * Copyright 1998-2005 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -25,8 +25,6 @@
 
 #include "slap.h"
 
-#ifdef LDAP_EXOP_X_CANCEL
-
 #include <lber_pvt.h>
 #include <lutil.h>
 
@@ -68,6 +66,8 @@ int cancel_extop( Operation *op, SlapReply *rs )
        LDAP_STAILQ_FOREACH( o, &op->o_conn->c_pending_ops, o_next ) {
                if ( o->o_msgid == opid ) {
                        LDAP_STAILQ_REMOVE( &op->o_conn->c_pending_ops, o, slap_op, o_next );
+                       LDAP_STAILQ_NEXT(o, o_next) = NULL;
+                       op->o_conn->c_n_ops_pending--;
                        slap_op_free( o );
                        found = 1;
                        break;
@@ -127,5 +127,3 @@ int cancel_extop( Operation *op, SlapReply *rs )
 
        return rc;
 }
-
-#endif /* LDAP_EXOP_X_CANCEL */