Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2E6BD200D14 for ; Tue, 3 Oct 2017 21:37:45 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2D21E160BD5; Tue, 3 Oct 2017 19:37:45 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 72C591609BD for ; Tue, 3 Oct 2017 21:37:44 +0200 (CEST) Received: (qmail 85086 invoked by uid 500); 3 Oct 2017 19:37:43 -0000 Mailing-List: contact commits-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list commits@qpid.apache.org Received: (qmail 85072 invoked by uid 99); 3 Oct 2017 19:37:43 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Oct 2017 19:37:43 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 6B5B3F56AE; Tue, 3 Oct 2017 19:37:43 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aconway@apache.org To: commits@qpid.apache.org Date: Tue, 03 Oct 2017 19:37:43 -0000 Message-Id: <83f305e5ff8443f494c43dfff5241303@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] qpid-proton git commit: PROTON-1560: ruby: fix cmake test names archived-at: Tue, 03 Oct 2017 19:37:45 -0000 Repository: qpid-proton Updated Branches: refs/heads/master d39904c45 -> b36b70c2a PROTON-1560: ruby: fix cmake test names Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/c015ceb1 Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/c015ceb1 Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/c015ceb1 Branch: refs/heads/master Commit: c015ceb178a03e8a88e17079ba03f646693569b5 Parents: d39904c Author: Alan Conway Authored: Fri Sep 29 09:46:59 2017 -0400 Committer: Alan Conway Committed: Tue Oct 3 14:55:40 2017 -0400 ---------------------------------------------------------------------- proton-c/include/proton/delivery.h | 8 ++++---- proton-c/src/core/engine-internal.h | 1 + proton-c/src/core/transport.c | 7 +++++++ 3 files changed, 12 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c015ceb1/proton-c/include/proton/delivery.h ---------------------------------------------------------------------- diff --git a/proton-c/include/proton/delivery.h b/proton-c/include/proton/delivery.h index 6cdd854..966e750 100644 --- a/proton-c/include/proton/delivery.h +++ b/proton-c/include/proton/delivery.h @@ -277,11 +277,11 @@ PN_EXTERN bool pn_delivery_current(pn_delivery_t *delivery); * Aborting means the sender cannot complete the delivery. It will not send any * more data and all data received so far should be discarded by the receiver. * - * The aborted delivery is automatically settled, and can never be used again. + * If some data has already been sent on the network, an AMQP "aborted" frame + * will be sent to inform the peer. If no data has yet been sent, the delivery + * will simply be dropped. * - * @note You should only use pn_delivery_abort() if you are "streaming" messages - * in multiple parts and you need to abort after part of the message has been sent - * with pn_link_send() + * The delivery will be freed, and cannot be used after the call. * * @see pn_delivery_aborted() * http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c015ceb1/proton-c/src/core/engine-internal.h ---------------------------------------------------------------------- diff --git a/proton-c/src/core/engine-internal.h b/proton-c/src/core/engine-internal.h index 2bfed83..39d1572 100644 --- a/proton-c/src/core/engine-internal.h +++ b/proton-c/src/core/engine-internal.h @@ -58,6 +58,7 @@ struct pn_endpoint_t { typedef struct { pn_sequence_t id; + bool sending; bool sent; bool init; } pn_delivery_state_t; http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c015ceb1/proton-c/src/core/transport.c ---------------------------------------------------------------------- diff --git a/proton-c/src/core/transport.c b/proton-c/src/core/transport.c index 216adb6..c825136 100644 --- a/proton-c/src/core/transport.c +++ b/proton-c/src/core/transport.c @@ -96,6 +96,7 @@ static pn_delivery_t *pni_delivery_map_get(pn_delivery_map_t *db, pn_sequence_t static void pn_delivery_state_init(pn_delivery_state_t *ds, pn_delivery_t *delivery, pn_sequence_t id) { ds->id = id; + ds->sending = false; ds->sent = false; ds->init = true; } @@ -2162,6 +2163,11 @@ static int pni_post_disp(pn_transport_t *transport, pn_delivery_t *delivery) static int pni_process_tpwork_sender(pn_transport_t *transport, pn_delivery_t *delivery, bool *settle) { + if (delivery->aborted && !delivery->state.sending) { + // Aborted delivery with no data yet sent, drop it. + *settle = true; + return 0; + } *settle = false; pn_link_t *link = delivery->link; pn_session_state_t *ssn_state = &link->session->state; @@ -2195,6 +2201,7 @@ static int pni_process_tpwork_sender(pn_transport_t *transport, pn_delivery_t *d false /* Batchable */ ); if (count < 0) return count; + if (count > 0) delivery->state.sending = true; xfr_posted = true; ssn_state->outgoing_transfer_count += count; ssn_state->remote_incoming_window -= count; --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org For additional commands, e-mail: commits-help@qpid.apache.org