qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject [1/2] qpid-proton git commit: PROTON-1560: ruby: fix cmake test names
Date Tue, 03 Oct 2017 19:37:43 GMT
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 <aconway@redhat.com>
Authored: Fri Sep 29 09:46:59 2017 -0400
Committer: Alan Conway <aconway@redhat.com>
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


Mime
View raw message