Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java')
-rw-r--r--jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java43
1 files changed, 35 insertions, 8 deletions
diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java b/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java
index 50cfa922d9..9916ddc92b 100644
--- a/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java
+++ b/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java
@@ -19,6 +19,7 @@
package org.eclipse.jetty.io.ssl;
import java.io.IOException;
+import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.ClosedChannelException;
import java.util.concurrent.Executor;
@@ -334,7 +335,7 @@ public class SslConnection extends AbstractConnection
public DecryptedEndPoint()
{
// Disable idle timeout checking: no scheduler and -1 timeout for this instance.
- super(null, getEndPoint().getLocalAddress(), getEndPoint().getRemoteAddress());
+ super(null);
super.setIdleTimeout(-1);
}
@@ -357,6 +358,18 @@ public class SslConnection extends AbstractConnection
}
@Override
+ public InetSocketAddress getLocalAddress()
+ {
+ return getEndPoint().getLocalAddress();
+ }
+
+ @Override
+ public InetSocketAddress getRemoteAddress()
+ {
+ return getEndPoint().getRemoteAddress();
+ }
+
+ @Override
protected WriteFlusher getWriteFlusher()
{
return super.getWriteFlusher();
@@ -885,12 +898,11 @@ public class SslConnection extends AbstractConnection
}
@Override
- public void shutdownOutput()
+ public void doShutdownOutput()
{
boolean ishut = isInputShutdown();
- boolean oshut = isOutputShutdown();
if (LOG.isDebugEnabled())
- LOG.debug("{} shutdownOutput: oshut={}, ishut={}", SslConnection.this, oshut, ishut);
+ LOG.debug("{} shutdownOutput: ishut={}", SslConnection.this, ishut);
if (ishut)
{
// Aggressively close, since inbound close alert has already been processed
@@ -899,7 +911,7 @@ public class SslConnection extends AbstractConnection
// reply. If a TLS close reply is sent, most implementations send a RST.
getEndPoint().close();
}
- else if (!oshut)
+ else
{
try
{
@@ -931,12 +943,27 @@ public class SslConnection extends AbstractConnection
}
@Override
- public void close()
+ public void doClose()
{
// First send the TLS Close Alert, then the FIN
- shutdownOutput();
+ if (!_sslEngine.isOutboundDone())
+ {
+ try
+ {
+ synchronized (this) // TODO review synchronized boundary
+ {
+ _sslEngine.closeOutbound();
+ flush(BufferUtil.EMPTY_BUFFER); // Send close handshake
+ ensureFillInterested();
+ }
+ }
+ catch (Exception e)
+ {
+ LOG.ignore(e);
+ }
+ }
getEndPoint().close();
- super.close();
+ super.doClose();
}
@Override

Back to the top