You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ra...@apache.org on 2015/08/28 22:54:50 UTC
[3/3] qpid-proton git commit: Resolved issues around handling the
Flow performative.
Resolved issues around handling the Flow performative.
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/8ff9063d
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/8ff9063d
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/8ff9063d
Branch: refs/heads/rajith-codec
Commit: 8ff9063d6015166c54630bcb71c62864ff49e8a8
Parents: 374aa9c
Author: Rajith Attapattu <ra...@apache.org>
Authored: Fri Aug 28 16:54:14 2015 -0400
Committer: Rajith Attapattu <ra...@apache.org>
Committed: Fri Aug 28 16:54:14 2015 -0400
----------------------------------------------------------------------
.../qpid/proton/engine/impl/TransportImpl2.java | 37 ++++++++------------
.../org/apache/qpid/proton/transport2/Flow.java | 2 +-
2 files changed, 16 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/8ff9063d/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl2.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl2.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl2.java
index 82b504e..8ae4a4c 100644
--- a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl2.java
+++ b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl2.java
@@ -740,7 +740,7 @@ public class TransportImpl2 extends EndpointImpl
attach.setInitialDeliveryCount(0);
}
- //writeFrame(transportSession.getLocalChannel(), attach, null, null);
+ writeFrame(transportSession.getLocalChannel(), attach, null, null);
transportLink.sentAttach();
}
}
@@ -1140,33 +1140,26 @@ public class TransportImpl2 extends EndpointImpl
public void handleFlow(Flow flow, Integer channel)
{
TransportSession transportSession = _remoteSessions.get(channel);
+ org.apache.qpid.proton.amqp.transport.Flow f = new org.apache.qpid.proton.amqp.transport.Flow();
+ f.setAvailable(UnsignedInteger.valueOf(flow.getAvailable()));
+ f.setDeliveryCount(UnsignedInteger.valueOf(flow.getDeliveryCount()));
+ f.setDrain(f.getDrain());
+ f.setEcho(flow.getEcho());
+ f.setHandle(UnsignedInteger.valueOf(flow.getHandle()));
+ f.setIncomingWindow(UnsignedInteger.valueOf(flow.getIncomingWindow()));
+ f.setLinkCredit(UnsignedInteger.valueOf(flow.getLinkCredit()));
+ f.setNextIncomingId(UnsignedInteger.valueOf(flow.getNextIncomingId()));
+ f.setOutgoingWindow(UnsignedInteger.valueOf(flow.getNextOutgoingId()));
+ f.setOutgoingWindow(UnsignedInteger.valueOf(flow.getOutgoingWindow()));
+ f.setProperties(flow.getProperties());
+
if(transportSession == null)
{
// TODO - fail due to attach on non-begun session
}
else
{
- int inext = flow.getNextIncomingId();
- int iwin = flow.getIncomingWindow();
-
- if(inext != -1)
- {
- transportSession.setRemoteNextIncomingId(UnsignedInteger.valueOf(inext));
- transportSession.setRemoteIncomingWindow(UnsignedInteger.valueOf(inext+iwin-transportSession.getNextOutgoingId().intValue()));
- }
- else
- {
- transportSession.setRemoteIncomingWindow(UnsignedInteger.valueOf(iwin));
- }
- transportSession.setRemoteNextOutgoingId(UnsignedInteger.valueOf(flow.getNextOutgoingId()));
- transportSession.setRemoteOutgoingWindow(UnsignedInteger.valueOf(flow.getOutgoingWindow()));
-
- if(flow.getHandle() != -1)
- {
- TransportLink transportLink = transportSession.getLinkFromRemoteHandle(UnsignedInteger.valueOf(flow.getHandle()));
- transportLink.setRemoteLinkCredit(UnsignedInteger.valueOf(flow.getLinkCredit()));
- transportLink.setRemoteDeliveryCount(UnsignedInteger.valueOf(flow.getDeliveryCount()));
- }
+ transportSession.handleFlow(f);
}
}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/8ff9063d/proton-j/src/main/java/org/apache/qpid/proton/transport2/Flow.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/transport2/Flow.java b/proton-j/src/main/java/org/apache/qpid/proton/transport2/Flow.java
index b3b4de5..4cb92de 100644
--- a/proton-j/src/main/java/org/apache/qpid/proton/transport2/Flow.java
+++ b/proton-j/src/main/java/org/apache/qpid/proton/transport2/Flow.java
@@ -209,7 +209,7 @@ public final class Flow implements Encodable, Performative
case 2:
flow.setDrain(l.get(8) == null ? false : (Boolean) l.get(8));
case 3:
- flow.setAvailable((Integer) l.get(7));
+ flow.setAvailable(l.get(7) == null ? -1 : (Integer)l.get(7));
case 4:
flow.setLinkCredit((Integer) l.get(6));
case 5:
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org