qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject [2/2] qpid-proton git commit: NO-JIRA: ruby/python don't call on_sendable if link is closed/closing
Date Wed, 27 Apr 2016 21:07:11 GMT
NO-JIRA: ruby/python don't call on_sendable if link is closed/closing


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/75faa18e
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/75faa18e
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/75faa18e

Branch: refs/heads/master
Commit: 75faa18e9e07d56edc52cd595aa25994f8986ec5
Parents: 587f0d0
Author: Alan Conway <aconway@redhat.com>
Authored: Wed Apr 27 16:14:33 2016 -0400
Committer: Alan Conway <aconway@redhat.com>
Committed: Wed Apr 27 16:15:49 2016 -0400

----------------------------------------------------------------------
 proton-c/bindings/python/proton/handlers.py                    | 4 +++-
 proton-c/bindings/ruby/lib/handler/outgoing_message_handler.rb | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/75faa18e/proton-c/bindings/python/proton/handlers.py
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/proton/handlers.py b/proton-c/bindings/python/proton/handlers.py
index 301f20c..a1cf836 100644
--- a/proton-c/bindings/python/proton/handlers.py
+++ b/proton-c/bindings/python/proton/handlers.py
@@ -34,7 +34,9 @@ class OutgoingMessageHandler(Handler):
         self.delegate = delegate
 
     def on_link_flow(self, event):
-        if event.link.is_sender and event.link.credit:
+        if event.link.is_sender and event.link.credit \
+           and event.link.state & Endpoint.LOCAL_ACTIVE \
+           and event.link.state & Endpoint.REMOTE_ACTIVE :
             self.on_sendable(event)
 
     def on_delivery(self, event):

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/75faa18e/proton-c/bindings/ruby/lib/handler/outgoing_message_handler.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/handler/outgoing_message_handler.rb b/proton-c/bindings/ruby/lib/handler/outgoing_message_handler.rb
index 056a131..3f1f3f3 100644
--- a/proton-c/bindings/ruby/lib/handler/outgoing_message_handler.rb
+++ b/proton-c/bindings/ruby/lib/handler/outgoing_message_handler.rb
@@ -30,7 +30,9 @@ module Qpid::Proton::Handler
     end
 
     def on_link_flow(event)
-      self.on_sendable(event) if event.link.sender? && event.link.credit > 0
+      self.on_sendable(event) if event.link.sender? && event.link.credit > 0 &&
+                                 (event.link.state & Qpid::Proton::Endpoint::LOCAL_ACTIVE)
&&
+                                 (event.link.state & Qpid::Proton::Endpoint::REMOTE_ACTIVE)
     end
 
     def on_delivery(event)


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


Mime
View raw message