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 2023/03/02 13:18:17 UTC
[qpid-proton-j] 08/09: PROTON-2687: restore old gate to original structure, add additional protection to new gates, remove some extraneous leftovers from tests
This is an automated email from the ASF dual-hosted git repository.
robbie pushed a commit to branch 0.34.x
in repository https://gitbox.apache.org/repos/asf/qpid-proton-j.git
commit 696d39d8ea046024755bfb1c9d1e44a5cd369ff7
Author: Robbie Gemmell <ro...@apache.org>
AuthorDate: Wed Mar 1 13:26:17 2023 +0000
PROTON-2687: restore old gate to original structure, add additional protection to new gates, remove some extraneous leftovers from tests
(cherry picked from commit 9a8979e893c9186fb55c24eb32584e3f6f2d4d0b)
---
.../java/org/apache/qpid/proton/engine/impl/TransportImpl.java | 7 +++----
.../org/apache/qpid/proton/engine/impl/TransportImplTest.java | 10 +---------
2 files changed, 4 insertions(+), 13 deletions(-)
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 6653bd79..da2e9abb 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
@@ -561,18 +561,17 @@ public class TransportImpl extends EndpointImpl
SessionImpl session = snd.getSession();
TransportSession tpSession = session.getTransportSession();
- if (tpSession.endSent()) {
+ if (tpSession != null && tpSession.endSent()) {
// Too late to action this work, clear it.
return true;
}
- boolean localChannelSet = tpSession.isLocalChannelSet();
boolean wasDone = delivery.isDone();
if(!delivery.isDone() &&
(delivery.getDataLength() > 0 || delivery != snd.current()) &&
tpSession.hasOutgoingCredit() && tpLink.hasCredit() &&
- localChannelSet &&
+ tpSession.isLocalChannelSet() &&
tpLink.getLocalHandle() != null && !_frameWriter.isFull())
{
DeliveryImpl inProgress = tpLink.getInProgressDelivery();
@@ -682,7 +681,7 @@ public class TransportImpl extends EndpointImpl
}
}
- if(wasDone && delivery.getLocalState() != null && localChannelSet)
+ if(wasDone && delivery.getLocalState() != null && tpSession.isLocalChannelSet())
{
TransportDelivery tpDelivery = delivery.getTransportDelivery();
// Use cached object as holder of data for immediate write to the FrameWriter
diff --git a/proton-j/src/test/java/org/apache/qpid/proton/engine/impl/TransportImplTest.java b/proton-j/src/test/java/org/apache/qpid/proton/engine/impl/TransportImplTest.java
index 56e518bf..82ff4c81 100644
--- a/proton-j/src/test/java/org/apache/qpid/proton/engine/impl/TransportImplTest.java
+++ b/proton-j/src/test/java/org/apache/qpid/proton/engine/impl/TransportImplTest.java
@@ -4981,10 +4981,6 @@ public class TransportImplTest
// Send the necessary responses to End
End end = new End();
- begin.setRemoteChannel(UnsignedShort.valueOf((short) 0));
- begin.setNextOutgoingId(UnsignedInteger.ONE);
- begin.setIncomingWindow(UnsignedInteger.valueOf(1024));
- begin.setOutgoingWindow(UnsignedInteger.valueOf(1024));
transport.handleFrame(new TransportFrame(0, end, null));
assertEndpointState(session, EndpointState.CLOSED, EndpointState.CLOSED);
@@ -5035,7 +5031,7 @@ public class TransportImplTest
assertNull("Should not yet have a delivery", sender.current());
- // Send the necessary responses to open/begin/attach as well as a transfer
+ // Send the necessary responses to open/begin
transport.handleFrame(new TransportFrame(0, new Open(), null));
Begin begin = new Begin();
@@ -5094,10 +5090,6 @@ public class TransportImplTest
// Send the necessary responses to End
End end = new End();
- begin.setRemoteChannel(UnsignedShort.valueOf((short) 0));
- begin.setNextOutgoingId(UnsignedInteger.ONE);
- begin.setIncomingWindow(UnsignedInteger.valueOf(1024));
- begin.setOutgoingWindow(UnsignedInteger.valueOf(1024));
transport.handleFrame(new TransportFrame(0, end, null));
assertEndpointState(session, EndpointState.CLOSED, EndpointState.CLOSED);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org