You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ch...@apache.org on 2017/09/15 18:48:59 UTC

[6/7] qpid-dispatch git commit: DISPATCH-807: Implement Q3 limits based on send session outgoing bytes

DISPATCH-807: Implement Q3 limits based on send session outgoing bytes


Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/47be10f5
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/47be10f5
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/47be10f5

Branch: refs/heads/DISPATCH-807-1
Commit: 47be10f59dc7b0ae16275a3409b7f40aef177783
Parents: ff9d9ed
Author: Chuck Rolke <cr...@redhat.com>
Authored: Thu Sep 14 17:00:09 2017 -0400
Committer: Chuck Rolke <cr...@redhat.com>
Committed: Fri Sep 15 14:47:26 2017 -0400

----------------------------------------------------------------------
 include/qpid/dispatch/message.h | 3 +++
 src/message.c                   | 5 +++--
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/47be10f5/include/qpid/dispatch/message.h
----------------------------------------------------------------------
diff --git a/include/qpid/dispatch/message.h b/include/qpid/dispatch/message.h
index 61e810e..3ad11b0 100644
--- a/include/qpid/dispatch/message.h
+++ b/include/qpid/dispatch/message.h
@@ -42,6 +42,9 @@
 // Q2 defines the number of buffers allowed in a message's buffer chain
 #define QD_QLIMIT_Q2_UPPER 128
 #define QD_QLIMIT_Q2_LOWER 120
+//
+// Q3 defines the number of bytes allowed in a session's outgoing_bytes
+#define QD_QLIMIT_Q3_UPPER (256 * 1000)
 
 // Callback for status change (confirmed persistent, loaded-in-memory, etc.)
 

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/47be10f5/src/message.c
----------------------------------------------------------------------
diff --git a/src/message.c b/src/message.c
index f82fd47..16ced8c 100644
--- a/src/message.c
+++ b/src/message.c
@@ -1497,10 +1497,11 @@ void qd_message_send(qd_message_t *in_msg,
     }
 
     buf = msg->cursor.buffer;
-
     assert (buf);
 
-    while (buf) {
+    pn_session_t     *pns  = pn_link_session(pnl);
+
+    while (buf && pn_session_outgoing_bytes(pns) < QD_QLIMIT_Q3_UPPER) {
         size_t buf_size = qd_buffer_size(buf);
 
         // This will send the remaining data in the buffer if any.


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org