Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2015-03-22 07:25:02 +0000
committerEike Stepper2015-03-22 07:25:02 +0000
commitd1f840408ab9b1c9c246487480fcad4010a68f10 (patch)
tree4d046bb9f1a083efe90411e37aef805a0b10ec7a /plugins/org.eclipse.net4j.tcp
parentb7060b4ced7ce72e73e7c9b357fcbcac8e604e6a (diff)
downloadcdo-d1f840408ab9b1c9c246487480fcad4010a68f10.tar.gz
cdo-d1f840408ab9b1c9c246487480fcad4010a68f10.tar.xz
cdo-d1f840408ab9b1c9c246487480fcad4010a68f10.zip
[462777] Channel not closed after unsuccessful OpenSessionIndication
https://bugs.eclipse.org/bugs/show_bug.cgi?id=462777
Diffstat (limited to 'plugins/org.eclipse.net4j.tcp')
-rw-r--r--plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/TCPConnector.java7
-rw-r--r--plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/ssl/SSLBuffer.java4
2 files changed, 9 insertions, 2 deletions
diff --git a/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/TCPConnector.java b/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/TCPConnector.java
index 3e18fb8e23..bed021ce3d 100644
--- a/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/TCPConnector.java
+++ b/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/TCPConnector.java
@@ -308,12 +308,19 @@ public abstract class TCPConnector extends Connector implements ITCPConnector, I
IBuffer buffer = channelSendQueue.peek();
if (buffer != null)
{
+ boolean closeChannelAfterMe = buffer.isCCAM();
+
if (buffer.write(socketChannel))
{
writeQueue.poll();
channelSendQueue.poll();
buffer.release();
}
+
+ if (closeChannelAfterMe)
+ {
+ channel.close();
+ }
}
}
}
diff --git a/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/ssl/SSLBuffer.java b/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/ssl/SSLBuffer.java
index 6d38d74587..69dc2fd746 100644
--- a/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/ssl/SSLBuffer.java
+++ b/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/ssl/SSLBuffer.java
@@ -90,7 +90,7 @@ public class SSLBuffer extends Buffer
payloadSize = (short)-payloadSize;
}
- payloadSize -= EOS_OFFSET;
+ payloadSize -= FLAGS_OFFSET;
byteBuffer.position(IBuffer.HEADER_SIZE);
setState(BufferState.READING_HEADER);
@@ -149,7 +149,7 @@ public class SSLBuffer extends Buffer
throw new IllegalStateException("channelID == NO_CHANNEL"); //$NON-NLS-1$
}
- int payloadSize = byteBuffer.position() - IBuffer.HEADER_SIZE + EOS_OFFSET;
+ int payloadSize = byteBuffer.position() - IBuffer.HEADER_SIZE + FLAGS_OFFSET;
if (isEOS())
{
payloadSize = -payloadSize;

Back to the top