From 4b3a815ad114ea25eb802fa16e99eb8bfb9f1b4f Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Fri, 22 May 2009 18:10:39 +0000 Subject: [PATCH] ITS#6137: Fail Cancel(pending operation) instead of discarding the operation. --- servers/slapd/cancel.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/servers/slapd/cancel.c b/servers/slapd/cancel.c index ef35046c0a..5e65e090db 100644 --- a/servers/slapd/cancel.c +++ b/servers/slapd/cancel.c @@ -68,12 +68,14 @@ 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, Operation, o_next ); - LDAP_STAILQ_NEXT(o, o_next) = NULL; - op->o_conn->c_n_ops_pending--; - slap_op_free( o, NULL ); ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex ); - return LDAP_SUCCESS; + /* TODO: We could instead remove the cancelled operation + * from c_pending_ops like Abandon does, and send its + * response here. Not if it is pending because of a + * congested connection though. + */ + rs->sr_text = "too busy for Cancel, try Abandon instead"; + return LDAP_CANNOT_CANCEL; } } -- 2.39.5