qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject [23/41] qpid-proton git commit: PROTON-1856: [ruby] auto_accept overwriting user state
Date Wed, 04 Jul 2018 15:57:55 GMT
PROTON-1856: [ruby] auto_accept overwriting user state

MessagomgAdapter was incorrectly checking settled? to determine if the local
handler had settled a transfer, but #settled? returns the *remote* state.  For a
delivery that was not yet settled remotely, this would over-write the state set
by the user handler.

Check for local_state == 0 instead.


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

Branch: refs/heads/go1
Commit: c7205a63db7d14e209d627be9be8314a49536e57
Parents: 24a142e
Author: Alan Conway <aconway@redhat.com>
Authored: Fri Jun 8 11:50:48 2018 -0400
Committer: Alan Conway <aconway@redhat.com>
Committed: Wed Jun 13 08:50:05 2018 -0400

----------------------------------------------------------------------
 ruby/lib/core/transfer.rb             | 2 +-
 ruby/lib/handler/messaging_adapter.rb | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c7205a63/ruby/lib/core/transfer.rb
----------------------------------------------------------------------
diff --git a/ruby/lib/core/transfer.rb b/ruby/lib/core/transfer.rb
index ded3726..1f79c3d 100644
--- a/ruby/lib/core/transfer.rb
+++ b/ruby/lib/core/transfer.rb
@@ -51,7 +51,7 @@ module Qpid::Proton
     # @deprecated use {#id}
     deprecated_alias :tag, :id
 
-    # @return [Boolean] True if the transfer has is remotely settled.
+    # @return [Boolean] True if the transfer is remotely settled.
     proton_caller :settled?
 
     # @return [Integer] Remote state of the transfer, one of the values in {State}

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c7205a63/ruby/lib/handler/messaging_adapter.rb
----------------------------------------------------------------------
diff --git a/ruby/lib/handler/messaging_adapter.rb b/ruby/lib/handler/messaging_adapter.rb
index 8348209..ab7234b 100644
--- a/ruby/lib/handler/messaging_adapter.rb
+++ b/ruby/lib/handler/messaging_adapter.rb
@@ -106,11 +106,11 @@ module Qpid::Proton
             else
               begin
                 delegate(:on_message, d, d.message)
-                d.accept if d.receiver.auto_accept  && !d.settled?
+                d.accept if d.receiver.auto_accept && d.local_state == 0
               rescue Reject
-                d.reject unless d.settled?
+                d.reject
               rescue Release
-                d.release unless d.settled?
+                d.release
               end
             end
           end


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


Mime
View raw message