Author: remm
Date: Wed Jul 15 16:20:38 2015
New Revision: 1691244
URL: http://svn.apache.org/r1691244
Log:
Add ALPN support to NIO by passing the socket wrapper to the channel.
Modified:
tomcat/trunk/java/org/apache/tomcat/util/net/NioChannel.java
tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
tomcat/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java
Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioChannel.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioChannel.java?rev=1691244&r1=1691243&r2=1691244&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioChannel.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioChannel.java Wed Jul 15
16:20:38 2015
@@ -42,6 +42,7 @@ public class NioChannel implements ByteC
protected static ByteBuffer emptyBuf = ByteBuffer.allocate(0);
protected SocketChannel sc = null;
+ protected SocketWrapperBase<NioChannel> socket = null;
protected final SocketBufferHandler bufHandler;
@@ -65,6 +66,10 @@ public class NioChannel implements ByteC
}
+ void setSocketWrapper(SocketWrapperBase<NioChannel> socket) {
+ this.socket = socket;
+ }
+
/**
* Free the channel memory
*/
Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?rev=1691244&r1=1691243&r2=1691244&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Wed Jul 15
16:20:38 2015
@@ -731,6 +731,7 @@ public class NioEndpoint extends Abstrac
public void register(final NioChannel socket) {
socket.setPoller(this);
NioSocketWrapper ka = new NioSocketWrapper(socket,
NioEndpoint.this);
+ socket.setSocketWrapper(ka);
ka.setPoller(this);
ka.setReadTimeout(getSocketProperties().getSoTimeout());
ka.setWriteTimeout(getSocketProperties().getSoTimeout());
Modified: tomcat/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java?rev=1691244&r1=1691243&r2=1691244&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java Wed Jul
15 16:20:38 2015
@@ -185,6 +185,9 @@ public class SecureNioChannel extends Ni
throw new
IOException(sm.getString("channel.nio.ssl.notHandshaking"));
}
case FINISHED: {
+ if (endpoint.hasNegotiableProtocols() && sslEngine
instanceof SSLUtil.ProtocolInfo) {
+ socket.setNegotiatedProtocol(((SSLUtil.ProtocolInfo)
sslEngine).getNegotiatedProtocol());
+ }
//we are complete if we have delivered the last package
handshakeComplete = !netOutBuffer.hasRemaining();
//return 0 if we are complete, otherwise we still have
data to write
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]