Updated to NPN API version 1.1.0, calling NextProtoNego.remove(), instead of using AtomicReferences to clear the SSLEngine references.

This commit is contained in:
Simone Bordet 2012-05-26 22:44:57 +02:00
parent 146f5edfde
commit f41e43bce3
2 changed files with 1 additions and 19 deletions

View File

@ -334,15 +334,6 @@ public class SPDYClient
};
endPoint.setConnection(sslConnection);
final AsyncEndPoint sslEndPoint = sslConnection.getSslEndPoint();
// Instances of the ClientProvider inner class strong reference the
// SslEndPoint (via lexical scoping), which strong references the SSLEngine.
// Since NextProtoNego stores in a WeakHashMap the SSLEngine as key
// and this instance as value, we are in the situation where the value
// of a WeakHashMap refers indirectly to the key, which is bad because
// the entry will never be removed from the WeakHashMap.
// We use AtomicReferences to be captured via lexical scoping,
// and we null them out above when the connection is closed.
NextProtoNego.put(engine, new NextProtoNego.ClientProvider()
{
@Override

View File

@ -188,15 +188,6 @@ public class SPDYServerConnector extends SelectChannelConnector
};
endPoint.setConnection(sslConnection);
final AsyncEndPoint sslEndPoint = sslConnection.getSslEndPoint();
// Instances of the ServerProvider inner class strong reference the
// SslEndPoint (via lexical scoping), which strong references the SSLEngine.
// Since NextProtoNego stores in a WeakHashMap the SSLEngine as key
// and this instance as value, we are in the situation where the value
// of a WeakHashMap refers indirectly to the key, which is bad because
// the entry will never be removed from the WeakHashMap.
// We use AtomicReferences to be captured via lexical scoping,
// and we null them out above when the connection is closed.
NextProtoNego.put(engine, new NextProtoNego.ServerProvider()
{
@Override
@ -288,7 +279,7 @@ public class SPDYServerConnector extends SelectChannelConnector
{
return flowControlEnabled;
}
public void setFlowControlEnabled(boolean flowControl)
{
this.flowControlEnabled = flowControl;