Make ReadAsync state overload 451 only and private.

This commit is contained in:
Nick Craver 2015-11-11 18:55:56 -05:00
parent d1221e82c1
commit a45a671b22
1 changed files with 7 additions and 7 deletions

View File

@ -68,14 +68,8 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
{
return ((Task<int>)asyncResult).Result;
}
#endif
public override Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
{
return _body.ReadAsync(new ArraySegment<byte>(buffer, offset, count), cancellationToken);
}
public Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken, object state)
private Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken, object state)
{
var tcs = new TaskCompletionSource<int>(state);
var task = _body.ReadAsync(new ArraySegment<byte>(buffer, offset, count), cancellationToken);
@ -97,6 +91,12 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
}, tcs, cancellationToken);
return tcs.Task;
}
#endif
public override Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
{
return _body.ReadAsync(new ArraySegment<byte>(buffer, offset, count), cancellationToken);
}
public override void Write(byte[] buffer, int offset, int count)
{