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. /// Gets the form collection.
/// </summary> /// </summary>
/// <returns>The form collection parsed from the request body.</returns> /// <returns>The form collection parsed from the request body.</returns>
public virtual Task<IReadableStringCollection> GetFormAsync() public abstract Task<IReadableStringCollection> GetFormAsync(CancellationToken cancel = default(CancellationToken));
{
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);
/// <summary> /// <summary>
/// Gets or set the owin.RequestProtocol. /// Gets or set the owin.RequestProtocol.

View File

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

View File

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