netty5/handler/src/main/java/io/netty/handler
Norman Maurer f2eb106f1e Ensure we only add OpenSslEngine to the OpenSslEngineMap when handshake is started
Motivation:

We need to ensure we only add the OpenSslEngine to the OpenSslEngineMap when the handshake is started as otherwise we may produce a memory leak when the OpenSslEngine is created but not actually used. This can for example happen if we encounter a connection refused from the remote peer. In this case we will never remove the OpenSslEngine from the OpenSslEngineMap and so it will never be collected (as we hold a reference). This has as affect that the finalizer will never be run as well.

Modifications:

- Lazy add the OpenSslEngine to the OpenSslEngineMap to elimate possible leak.
- Call OpenSslEngine.shutdown() when SslHandler is removed from the ChannelPipeline to free memory asap in all cases.

Result:

No more memory leak with OpenSslEngine if connection is refused.
2016-01-05 11:26:24 +01:00
..
ipfilter Revert "Consistent naming style for enum" 2015-08-28 20:50:05 +02:00
logging [#3798] Extract dump method to ByteBufUtil 2015-06-09 06:21:20 +02:00
ssl Ensure we only add OpenSslEngine to the OpenSslEngineMap when handshake is started 2016-01-05 11:26:24 +01:00
stream Use OneTimeTask where possible to reduce object creation 2015-11-20 14:41:41 -08:00
timeout Use OneTimeTask where possible to reduce object creation 2015-11-20 14:41:41 -08:00
traffic Use OneTimeTask where possible to reduce object creation 2015-11-20 14:41:41 -08:00