You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2015/03/05 18:19:27 UTC

qpid-proton git commit: PROTON-833: check the local channel is still set

Repository: qpid-proton
Updated Branches:
  refs/heads/master c65e89730 -> 8f810c375


PROTON-833: check the local channel is still set


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

Branch: refs/heads/master
Commit: 8f810c3757c21ef32589b1bdd276e83d21659eb3
Parents: c65e897
Author: Robert Gemmell <ro...@apache.org>
Authored: Thu Mar 5 17:17:45 2015 +0000
Committer: Robert Gemmell <ro...@apache.org>
Committed: Thu Mar 5 17:17:45 2015 +0000

----------------------------------------------------------------------
 .../qpid/proton/engine/impl/TransportImpl.java  | 30 ++++++++++++--------
 1 file changed, 18 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/8f810c37/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
index b35e408..852489a 100644
--- a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
+++ b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
@@ -394,6 +394,7 @@ public class TransportImpl extends EndpointImpl
 
                     if(((link.getLocalState() == EndpointState.CLOSED) || link.detached())
                        && transportLink.isLocalHandleSet()
+                       && transportSession.isLocalChannelSet()
                        && !_isCloseSent)
                     {
                         if((link instanceof SenderImpl)
@@ -528,6 +529,7 @@ public class TransportImpl extends EndpointImpl
         if(!delivery.isDone() &&
            (delivery.getDataLength() > 0 || delivery != snd.current()) &&
            tpSession.hasOutgoingCredit() && tpLink.hasCredit() &&
+           tpSession.isLocalChannelSet() &&
            tpLink.getLocalHandle() != null && !_frameWriter.isFull())
         {
             UnsignedInteger deliveryId = tpSession.getOutgoingDeliveryId();
@@ -624,20 +626,24 @@ public class TransportImpl extends EndpointImpl
         SessionImpl session = rcv.getSession();
         TransportSession tpSession = session.getTransportSession();
 
-        Disposition disposition = new Disposition();
-        disposition.setFirst(tpDelivery.getDeliveryId());
-        disposition.setLast(tpDelivery.getDeliveryId());
-        disposition.setRole(Role.RECEIVER);
-        disposition.setSettled(delivery.isSettled());
-
-        disposition.setState(delivery.getLocalState());
-        writeFrame(tpSession.getLocalChannel(), disposition, null,
-                   null);
-        if(delivery.isSettled())
+        if (tpSession.isLocalChannelSet())
         {
-            tpDelivery.settled();
+            Disposition disposition = new Disposition();
+            disposition.setFirst(tpDelivery.getDeliveryId());
+            disposition.setLast(tpDelivery.getDeliveryId());
+            disposition.setRole(Role.RECEIVER);
+            disposition.setSettled(delivery.isSettled());
+
+            disposition.setState(delivery.getLocalState());
+            writeFrame(tpSession.getLocalChannel(), disposition, null, null);
+            if (delivery.isSettled())
+            {
+                tpDelivery.settled();
+            }
+            return true;
         }
-        return true;
+
+        return false;
     }
 
     private void processReceiverFlow()


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