Change spelling of Cancelled to Canceled. Cleanup.

This commit is contained in:
Chris Ross 2014-08-25 14:18:18 -07:00
parent 5de5534982
commit 4b76d93801
12 changed files with 16 additions and 63 deletions

View File

@ -27,7 +27,6 @@ namespace Microsoft.AspNet.Security.Windows
{
internal const string VersionKey = "owin.Version";
internal const string OwinVersion = "1.0";
internal const string CallCancelledKey = "owin.CallCancelled";
internal const string RequestBodyKey = "owin.RequestBody";
internal const string RequestHeadersKey = "owin.RequestHeaders";

View File

@ -27,49 +27,6 @@ namespace Microsoft.Net.Http.Server
{
internal static class Constants
{
internal const string VersionKey = "owin.Version";
internal const string OwinVersion = "1.0";
internal const string CallCancelledKey = "owin.CallCancelled";
internal const string ServerCapabilitiesKey = "server.Capabilities";
internal const string RequestBodyKey = "owin.RequestBody";
internal const string RequestHeadersKey = "owin.RequestHeaders";
internal const string RequestSchemeKey = "owin.RequestScheme";
internal const string RequestMethodKey = "owin.RequestMethod";
internal const string RequestPathBaseKey = "owin.RequestPathBase";
internal const string RequestPathKey = "owin.RequestPath";
internal const string RequestQueryStringKey = "owin.RequestQueryString";
internal const string HttpRequestProtocolKey = "owin.RequestProtocol";
internal const string HttpResponseProtocolKey = "owin.ResponseProtocol";
internal const string ResponseStatusCodeKey = "owin.ResponseStatusCode";
internal const string ResponseReasonPhraseKey = "owin.ResponseReasonPhrase";
internal const string ResponseHeadersKey = "owin.ResponseHeaders";
internal const string ResponseBodyKey = "owin.ResponseBody";
internal const string ClientCertifiateKey = "ssl.ClientCertificate";
internal const string RemoteIpAddressKey = "server.RemoteIpAddress";
internal const string RemotePortKey = "server.RemotePort";
internal const string LocalIpAddressKey = "server.LocalIpAddress";
internal const string LocalPortKey = "server.LocalPort";
internal const string IsLocalKey = "server.IsLocal";
internal const string ServerOnSendingHeadersKey = "server.OnSendingHeaders";
internal const string ServerLoggerFactoryKey = "server.LoggerFactory";
internal const string OpaqueVersionKey = "opaque.Version";
internal const string OpaqueVersion = "1.0";
internal const string OpaqueFuncKey = "opaque.Upgrade";
internal const string OpaqueStreamKey = "opaque.Stream";
internal const string OpaqueCallCancelledKey = "opaque.CallCancelled";
internal const string SendFileVersionKey = "sendfile.Version";
internal const string SendFileVersion = "1.0";
internal const string SendFileSupportKey = "sendfile.Support";
internal const string SendFileConcurrencyKey = "sendfile.Concurrency";
internal const string Overlapped = "Overlapped";
internal const string HttpScheme = "http";
internal const string HttpsScheme = "https";
internal const string SchemeDelimiter = "://";

View File

@ -33,7 +33,7 @@ namespace Microsoft.Net.Http.Server
return Task.FromResult<object>(null);
}
internal static Task<T> CancelledTask<T>()
internal static Task<T> CanceledTask<T>()
{
TaskCompletionSource<T> tcs = new TaskCompletionSource<T>();
tcs.TrySetCanceled();

View File

@ -37,7 +37,7 @@ namespace Microsoft.Net.Http.Server
{
public sealed class RequestContext : IDisposable
{
internal static Action<object> AbortDelegate = Abort;
internal static readonly Action<object> AbortDelegate = Abort;
private WebListener _server;
private Request _request;

View File

@ -321,7 +321,7 @@ namespace Microsoft.Net.Http.Server
if (cancellationToken.IsCancellationRequested)
{
return Helpers.CancelledTask<int>();
return Helpers.CanceledTask<int>();
}
// TODO: Verbose log parameters

View File

@ -137,7 +137,7 @@ namespace Microsoft.Net.Http.Server
if (cancellationToken.IsCancellationRequested)
{
return Helpers.CancelledTask<int>();
return Helpers.CanceledTask<int>();
}
CancellationTokenRegistration cancellationRegistration;
@ -531,7 +531,7 @@ namespace Microsoft.Net.Http.Server
if (cancellationToken.IsCancellationRequested)
{
return Helpers.CancelledTask<int>();
return Helpers.CanceledTask<int>();
}
CancellationTokenRegistration cancellationRegistration;
@ -639,7 +639,7 @@ namespace Microsoft.Net.Http.Server
if (cancellationToken.IsCancellationRequested)
{
return Helpers.CancelledTask<int>();
return Helpers.CanceledTask<int>();
}
CancellationTokenRegistration cancellationRegistration;
@ -853,8 +853,8 @@ namespace Microsoft.Net.Http.Server
_leftToWrite = long.MaxValue;
}
// The final Content-Length async write can only be cancelled by CancelIoEx.
// Sync can only be cancelled by CancelSynchronousIo, but we don't attempt this right now.
// The final Content-Length async write can only be Canceled by CancelIoEx.
// Sync can only be Canceled by CancelSynchronousIo, but we don't attempt this right now.
[SuppressMessage("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", Justification =
"It is safe to ignore the return value on a cancel operation because the connection is being closed")]
internal unsafe void CancelLastWrite(SafeHandle requestQueueHandle)

View File

@ -667,7 +667,7 @@ namespace Microsoft.AspNet.WebSockets
throw;
}
// throw OperationCancelledException when canceled by the caller
// throw OperationCanceledException when canceled by the caller
// otherwise swallow the exception
cancellationToken.ThrowIfCancellationRequested();
}

View File

@ -41,9 +41,6 @@ namespace Microsoft.AspNet.Server.WebListener
var httpContext = new DefaultHttpContext((IFeatureCollection)env);
try
{
// General keys
// TODO: Assert.True(env.Get<CancellationToken>("owin.CallCancelled").CanBeCanceled);
var requestInfo = httpContext.GetFeature<IHttpRequestFeature>();
// Request Keys

View File

@ -190,7 +190,7 @@ namespace Microsoft.AspNet.Server.WebListener
}
[Fact]
public async Task Server_ClientDisconnects_CallCancelled()
public async Task Server_ClientDisconnects_CallCanceled()
{
TimeSpan interval = TimeSpan.FromSeconds(1);
ManualResetEvent received = new ManualResetEvent(false);
@ -225,7 +225,7 @@ namespace Microsoft.AspNet.Server.WebListener
}
[Fact]
public async Task Server_Abort_CallCancelled()
public async Task Server_Abort_CallCanceled()
{
TimeSpan interval = TimeSpan.FromSeconds(100);
ManualResetEvent received = new ManualResetEvent(false);

View File

@ -169,7 +169,7 @@ namespace Microsoft.Net.Http.Server
}
[Fact]
public async Task RequestBody_ReadAsyncAlreadyCancelled_ReturnsCanceledTask()
public async Task RequestBody_ReadAsyncAlreadyCanceled_ReturnsCanceledTask()
{
string address;
using (var server = Utilities.CreateHttpServer(out address))

View File

@ -229,7 +229,7 @@ namespace Microsoft.Net.Http.Server
}
[Fact]
public async Task ResponseBody_FirstWriteAsyncWithCancelledCancellationToken_CancelsButDoesNotAbort()
public async Task ResponseBody_FirstWriteAsyncWithCanceledCancellationToken_CancelsButDoesNotAbort()
{
string address;
using (var server = Utilities.CreateHttpServer(out address))
@ -251,7 +251,7 @@ namespace Microsoft.Net.Http.Server
}
[Fact]
public async Task ResponseBody_SecondWriteAsyncWithCancelledCancellationToken_CancelsButDoesNotAbort()
public async Task ResponseBody_SecondWriteAsyncWithCanceledCancellationToken_CancelsButDoesNotAbort()
{
string address;
using (var server = Utilities.CreateHttpServer(out address))

View File

@ -73,7 +73,7 @@ namespace Microsoft.Net.Http.Server
}
[Fact]
public async Task Server_ClientDisconnects_CallCancelled()
public async Task Server_ClientDisconnects_CallCanceled()
{
TimeSpan interval = TimeSpan.FromSeconds(1);
ManualResetEvent canceled = new ManualResetEvent(false);
@ -103,7 +103,7 @@ namespace Microsoft.Net.Http.Server
}
[Fact]
public async Task Server_Abort_CallCancelled()
public async Task Server_Abort_CallCanceled()
{
TimeSpan interval = TimeSpan.FromSeconds(1);
ManualResetEvent canceled = new ManualResetEvent(false);