Make CancellationToken a default param.

This commit is contained in:
Chris Ross 2014-06-25 09:15:11 -07:00
parent ff31b958fe
commit 55e491e354
3 changed files with 3 additions and 12 deletions

View File

@ -66,16 +66,7 @@ namespace Microsoft.AspNet.Http
/// Gets the form collection.
/// </summary>
/// <returns>The form collection parsed from the request body.</returns>
public virtual Task<IReadableStringCollection> GetFormAsync()
{
return GetFormAsync(CancellationToken.None);
}
/// <summary>
/// Gets the form collection.
/// </summary>
/// <returns>The form collection parsed from the request body.</returns>
public abstract Task<IReadableStringCollection> GetFormAsync(CancellationToken cancel);
public abstract Task<IReadableStringCollection> GetFormAsync(CancellationToken cancel = default(CancellationToken));
/// <summary>
/// Gets or set the owin.RequestProtocol.

View File

@ -129,7 +129,7 @@ namespace Microsoft.AspNet.PipelineCore
get { return QueryFeature.Query; }
}
public override Task<IReadableStringCollection> GetFormAsync(CancellationToken cancel)
public override Task<IReadableStringCollection> GetFormAsync(CancellationToken cancel = default(CancellationToken))
{
return FormFeature.GetFormAsync(cancel);
}

View File

@ -34,7 +34,7 @@ namespace Microsoft.AspNet.PipelineCore
_bodyStream = body;
if (!_bodyStream.CanSeek)
{
MemoryStream buffer = new MemoryStream();
var buffer = new MemoryStream();
await _bodyStream.CopyToAsync(buffer, 4096, cancel);
_bodyStream = buffer;
_request.Fetch(_features).Body = _bodyStream;