diff --git a/src/DotNetty.Handlers/Tls/TlsHandler.cs b/src/DotNetty.Handlers/Tls/TlsHandler.cs index 8e4749f..082fa0c 100644 --- a/src/DotNetty.Handlers/Tls/TlsHandler.cs +++ b/src/DotNetty.Handlers/Tls/TlsHandler.cs @@ -506,6 +506,13 @@ namespace DotNetty.Handlers.Tls } int read = currentReadFuture.Result; + + if (read == 0) + { + //Stream closed + return; + } + AddBufferToOutput(outputBuffer, read, output); } @@ -763,4 +770,4 @@ namespace DotNetty.Handlers.Tls public static bool HasAny(this TlsHandlerState value, TlsHandlerState testValue) => (value & testValue) != 0; } -} \ No newline at end of file +}