diff options
Diffstat (limited to 'jetty-io/src/main/java/org/eclipse/jetty/io/nio/SslConnection.java')
-rw-r--r-- | jetty-io/src/main/java/org/eclipse/jetty/io/nio/SslConnection.java | 61 |
1 files changed, 30 insertions, 31 deletions
diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SslConnection.java b/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SslConnection.java index a27f2d45a3..9bda79b919 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SslConnection.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SslConnection.java @@ -16,6 +16,7 @@ package org.eclipse.jetty.io.nio; import java.io.IOException; import java.nio.ByteBuffer; import java.util.concurrent.atomic.AtomicBoolean; + import javax.net.ssl.SSLEngine; import javax.net.ssl.SSLEngineResult; import javax.net.ssl.SSLEngineResult.HandshakeStatus; @@ -178,7 +179,9 @@ public class SslConnection extends AbstractConnection implements AsyncConnection // If we are handshook let the delegate connection if (_engine.getHandshakeStatus()!=HandshakeStatus.NOT_HANDSHAKING) - progress|=process(null,null); + { + progress=process(null,null); + } else { // handle the delegate connection @@ -204,10 +207,6 @@ public class SslConnection extends AbstractConnection implements AsyncConnection { _connection.onInputShutdown(); } - catch (ThreadDeath e) - { - throw e; - } catch(Throwable x) { LOG.warn("onInputShutdown failed", x); @@ -251,7 +250,7 @@ public class SslConnection extends AbstractConnection implements AsyncConnection super.onIdleExpired(); } } - + /* ------------------------------------------------------------ */ public void onInputShutdown() throws IOException { @@ -393,7 +392,8 @@ public class SslConnection extends AbstractConnection implements AsyncConnection finally { releaseBuffers(); - _progressed.set(some_progress); + if (some_progress) + _progressed.set(true); } return some_progress; } @@ -586,11 +586,6 @@ public class SslConnection extends AbstractConnection implements AsyncConnection return _engine; } - public SslConnection getSslConnection() - { - return SslConnection.this; - } - public void shutdownOutput() throws IOException { synchronized (SslConnection.this) @@ -647,10 +642,9 @@ public class SslConnection extends AbstractConnection implements AsyncConnection public int flush(Buffer buffer) throws IOException { - int size=buffer.length(); - process(null,buffer); - int flushed=size-buffer.length(); - return flushed; + int size = buffer.length(); + process(null, buffer); + return size-buffer.length(); } public int flush(Buffer header, Buffer buffer, Buffer trailer) throws IOException @@ -710,14 +704,19 @@ public class SslConnection extends AbstractConnection implements AsyncConnection _aEndp.scheduleWrite(); } - public void scheduleIdle() + public void onIdleExpired() + { + _aEndp.onIdleExpired(); + } + + public void setCheckForIdle(boolean check) { - _aEndp.scheduleIdle(); + _aEndp.setCheckForIdle(check); } - public void cancelIdle() + public boolean isCheckForIdle() { - _aEndp.cancelIdle(); + return _aEndp.isCheckForIdle(); } public void scheduleTimeout(Task task, long timeoutMs) @@ -797,20 +796,20 @@ public class SslConnection extends AbstractConnection implements AsyncConnection public String toString() { - Buffer i; - Buffer o; - Buffer u; - + int i; + int o; + int u; synchronized(SslConnection.this) { - i=_inbound; - o=_outbound; - u=_unwrapBuf; + i=_inbound==null?-1:_inbound.length(); + o=_outbound==null?-1:_outbound.length(); + u=_unwrapBuf==null?-1:_unwrapBuf.length(); } - return "SSL:"+_endp+" "+_engine.getHandshakeStatus()+" i/u/o="+(i==null?0:i.length())+"/"+(u==null?0:u.length())+"/"+(o==null?0:o.length()+(_ishut?" ishut":"")+(_oshut?" oshut":"")); + return String.format("SSL:%s %s i/u/o=%d/%d/%d ishut=%b oshut=%b", + _endp, + _engine.getHandshakeStatus(), + i, u, o, + _ishut, _oshut); } - } - - } |