Fix EOF handling of TlsStream.ReadAsync (#2094)

This commit is contained in:
Stephen Halter 2017-10-04 12:38:19 -07:00 committed by GitHub
parent 83e2084368
commit 156ddfc4e8
1 changed files with 6 additions and 0 deletions

View File

@ -139,6 +139,12 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Tls
if (OpenSsl.BIO_ctrl_pending(_inputBio) == 0)
{
var bytesRead = await _innerStream.ReadAsync(_inputBuffer, 0, _inputBuffer.Length, cancellationToken);
if (bytesRead == 0)
{
return 0;
}
OpenSsl.BIO_write(_inputBio, _inputBuffer, 0, bytesRead);
}