You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rh...@apache.org on 2015/02/16 21:14:34 UTC
qpid-proton git commit: prevent credit loop for draining links
Repository: qpid-proton
Updated Branches:
refs/heads/master 913a6fb6b -> ba04d501b
prevent credit loop for draining links
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/ba04d501
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/ba04d501
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/ba04d501
Branch: refs/heads/master
Commit: ba04d501bfae78a14f954a68d207ab76e37e5e16
Parents: 913a6fb
Author: Rafael Schloming <rh...@alum.mit.edu>
Authored: Mon Feb 16 14:59:08 2015 -0500
Committer: Rafael Schloming <rh...@alum.mit.edu>
Committed: Mon Feb 16 15:03:11 2015 -0500
----------------------------------------------------------------------
proton-c/src/handlers/flowcontroller.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ba04d501/proton-c/src/handlers/flowcontroller.c
----------------------------------------------------------------------
diff --git a/proton-c/src/handlers/flowcontroller.c b/proton-c/src/handlers/flowcontroller.c
index 705c25d..d7cc3b9 100644
--- a/proton-c/src/handlers/flowcontroller.c
+++ b/proton-c/src/handlers/flowcontroller.c
@@ -25,6 +25,7 @@
typedef struct {
int window;
+ int drained;
} pni_flowcontroller_t;
pni_flowcontroller_t *pni_flowcontroller(pn_handler_t *handler) {
@@ -46,8 +47,11 @@ static void pn_flowcontroller_dispatch(pn_handler_t *handler, pn_event_t *event,
case PN_LINK_REMOTE_OPEN:
case PN_LINK_FLOW:
case PN_DELIVERY:
- if (pn_link_is_receiver(link) && !pn_link_drained(link)) {
- pni_topup(link, window);
+ if (pn_link_is_receiver(link)) {
+ fc->drained += pn_link_drained(link);
+ if (!fc->drained) {
+ pni_topup(link, window);
+ }
}
break;
default:
@@ -62,5 +66,6 @@ pn_flowcontroller_t *pn_flowcontroller(int window) {
pn_flowcontroller_t *handler = pn_handler_new(pn_flowcontroller_dispatch, sizeof(pni_flowcontroller_t), NULL);
pni_flowcontroller_t *fc = pni_flowcontroller(handler);
fc->window = window;
+ fc->drained = 0;
return handler;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org