1 override of RequestAborted
Microsoft.AspNetCore.Http (1)
DefaultHttpContext.cs (1)
184public override CancellationToken RequestAborted
2 writes to RequestAborted
Microsoft.AspNetCore.Http (2)
Timeouts\RequestTimeoutsMiddleware.cs (2)
106context.RequestAborted = linkedCts.Token; 132context.RequestAborted = originalToken;
71 references to RequestAborted
Microsoft.AspNetCore.Authentication.Cookies (6)
CookieAuthenticationHandler.cs (6)
172ticket = await Options.SessionStore.RetrieveAsync(claim.Value, Context, Context.RequestAborted); 187await Options.SessionStore.RemoveAsync(_sessionKey!, Context, Context.RequestAborted); 264await Options.SessionStore.RenewAsync(_sessionKey, ticket, Context, Context.RequestAborted); 342await Options.SessionStore.RenewAsync(_sessionKey, ticket, Context, Context.RequestAborted); 346_sessionKey = await Options.SessionStore.StoreAsync(ticket, Context, Context.RequestAborted); 392await Options.SessionStore.RemoveAsync(_sessionKey, Context, Context.RequestAborted);
Microsoft.AspNetCore.Authentication.OAuth (2)
OAuthHandler.cs (2)
222var response = await Backchannel.SendAsync(requestMessage, Context.RequestAborted); 223var body = await response.Content.ReadAsStringAsync(Context.RequestAborted);
Microsoft.AspNetCore.Diagnostics (3)
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (1)
120if ((ex is OperationCanceledException || ex is IOException) && context.RequestAborted.IsCancellationRequested)
ExceptionHandler\ExceptionHandlerMiddlewareImpl.cs (2)
117if ((edi.SourceException is OperationCanceledException || edi.SourceException is IOException) && context.RequestAborted.IsCancellationRequested) 174if (await exceptionHandler.TryHandleAsync(context, edi.SourceException, context.RequestAborted))
Microsoft.AspNetCore.Diagnostics.HealthChecks (1)
HealthCheckMiddleware.cs (1)
46var result = await _healthCheckService.CheckHealthAsync(_healthCheckOptions.Predicate, httpContext.RequestAborted);
Microsoft.AspNetCore.Http (2)
Timeouts\RequestTimeoutsMiddleware.cs (2)
89if (context.RequestAborted.IsCancellationRequested) 98var originalToken = context.RequestAborted;
Microsoft.AspNetCore.Http.Abstractions (1)
HttpContext.cs (1)
98public CancellationToken RequestAborted => _context.RequestAborted;
Microsoft.AspNetCore.Http.Connections (3)
Internal\HttpConnectionContext.cs (2)
424TransportTask = transport.ProcessRequestAsync(context, context.RequestAborted); 484var tokenSource = CancellationTokenSource.CreateLinkedTokenSource(Cancellation.Token, nonClonedContext.RequestAborted, timeoutSource.Token);
Internal\Transports\LongPollingServerTransport.cs (1)
75if (context.RequestAborted.IsCancellationRequested)
Microsoft.AspNetCore.Http.Extensions (9)
DefaultProblemDetailsWriter.cs (1)
70cancellationToken: httpContext.RequestAborted));
HttpResponseJsonExtensions.cs (5)
96return WriteAsJsonAsyncSlow(response.BodyWriter, value, options, response.HttpContext.RequestAborted); 127return WriteAsJsonAsyncSlow(response, value, jsonTypeInfo, response.HttpContext.RequestAborted); 169return WriteAsJsonAsyncSlow(response, value, jsonTypeInfo, response.HttpContext.RequestAborted); 276response.HttpContext.RequestAborted); 326return WriteAsJsonAsyncSlow(response.BodyWriter, value, type, context, response.HttpContext.RequestAborted);
RequestDelegateFactory.cs (1)
95private static readonly MemberExpression RequestAbortedExpr = Expression.Property(HttpContextExpr, typeof(HttpContext).GetProperty(nameof(HttpContext.RequestAborted))!);
SendFileResponseExtensions.cs (2)
93var localCancel = useRequestAborted ? response.HttpContext.RequestAborted : cancellationToken; 115var localCancel = useRequestAborted ? response.HttpContext.RequestAborted : cancellationToken;
Microsoft.AspNetCore.Http.Results (6)
ServerSentEventsResult.cs (2)
57await SseFormatter.WriteAsync(stringEvents, httpContext.Response.Body, httpContext.RequestAborted); 63httpContext.RequestAborted);
src\aspnetcore\src\Shared\ResultsHelpers\FileResultHelper.cs (4)
39await StreamCopyOperation.CopyToAsync(fileStream, outputStream, count: null, bufferSize: 64 * 1024, cancel: context.RequestAborted); 44await StreamCopyOperation.CopyToAsync(fileStream, outputStream, rangeLength, BufferSize, context.RequestAborted); 64await outputStream.WriteAsync(buffer, context.RequestAborted); 78await outputStream.WriteAsync(buffer.Slice(from, length), context.RequestAborted);
Microsoft.AspNetCore.Identity (2)
AspNetRoleManager.cs (1)
34_cancel = contextAccessor?.HttpContext?.RequestAborted ?? CancellationToken.None;
AspNetUserManager.cs (1)
42_cancel = services?.GetService<IHttpContextAccessor>()?.HttpContext?.RequestAborted ?? CancellationToken.None;
Microsoft.AspNetCore.Mvc.Core (13)
Formatters\SystemTextJsonOutputFormatter.cs (3)
94await JsonSerializer.SerializeAsync(responseWriter, context.Object, jsonTypeInfo, httpContext.RequestAborted); 98await JsonSerializer.SerializeAsync(responseWriter, context.Object, SerializerOptions, httpContext.RequestAborted); 101catch (OperationCanceledException) when (context.HttpContext.RequestAborted.IsCancellationRequested) { }
Infrastructure\SystemTextJsonResultExecutor.cs (5)
69await JsonSerializer.SerializeAsync(responseWriter, value, objectType, jsonSerializerOptions, context.HttpContext.RequestAborted); 71catch (OperationCanceledException) when (context.HttpContext.RequestAborted.IsCancellationRequested) { } 82await JsonSerializer.SerializeAsync(transcodingStream, value, objectType, jsonSerializerOptions, context.HttpContext.RequestAborted); 83await transcodingStream.FlushAsync(context.HttpContext.RequestAborted); 85catch (OperationCanceledException) when (context.HttpContext.RequestAborted.IsCancellationRequested)
ModelBinding\Binders\CancellationTokenModelBinder.cs (1)
24var model = (object)bindingContext.HttpContext.RequestAborted;
src\aspnetcore\src\Shared\ResultsHelpers\FileResultHelper.cs (4)
39await StreamCopyOperation.CopyToAsync(fileStream, outputStream, count: null, bufferSize: 64 * 1024, cancel: context.RequestAborted); 44await StreamCopyOperation.CopyToAsync(fileStream, outputStream, rangeLength, BufferSize, context.RequestAborted); 64await outputStream.WriteAsync(buffer, context.RequestAborted); 78await outputStream.WriteAsync(buffer.Slice(from, length), context.RequestAborted);
Microsoft.AspNetCore.Mvc.Formatters.Xml (4)
XmlDataContractSerializerOutputFormatter.cs (2)
234value = await reader(value, context.HttpContext.RequestAborted); 236if (context.HttpContext.RequestAborted.IsCancellationRequested)
XmlSerializerOutputFormatter.cs (2)
212value = await reader(value, context.HttpContext.RequestAborted); 214if (context.HttpContext.RequestAborted.IsCancellationRequested)
Microsoft.AspNetCore.OutputCaching (7)
OutputCacheMiddleware.cs (6)
110await policy.CacheRequestAsync(context, httpContext.RequestAborted); 177await policy.ServeResponseAsync(context, httpContext.RequestAborted); 275await policy.ServeFromCacheAsync(context, context.HttpContext.RequestAborted); 317await context.CachedResponse.CopyToAsync(response.BodyWriter, context.HttpContext.RequestAborted); 347cacheEntry = await _outputCacheEntryDispatcher.ScheduleAsync(cacheContext.CacheKey, (Store: _store, CacheContext: cacheContext), static async (key, state) => await OutputCacheEntryFormatter.GetAsync(key, state.Store, state.CacheContext.HttpContext.RequestAborted)); 444_store, _logger, context.HttpContext.RequestAborted);
OutputCachePolicyBuilder.cs (1)
336if (!await r(c, c.HttpContext.RequestAborted))
Microsoft.AspNetCore.RateLimiting (3)
RateLimitingMiddleware.cs (3)
146await thisRequestOnRejected(new OnRejectedContext() { HttpContext = context, Lease = leaseContext.Lease! }, context.RequestAborted); 159var waitTask = CombinedWaitAsync(context, context.RequestAborted); 237if (ex is OperationCanceledException && context.RequestAborted.IsCancellationRequested)
Microsoft.AspNetCore.ResponseCaching (1)
ResponseCachingMiddleware.cs (1)
189await body.CopyToAsync(response.BodyWriter, context.HttpContext.RequestAborted);
Microsoft.AspNetCore.Routing (1)
ValidationEndpointFilterFactory.cs (1)
93await entry.Parameter.ValidateAsync(argument, validateContext, context.HttpContext.RequestAborted);
Microsoft.AspNetCore.StaticAssets (1)
StaticAssetsInvoker.cs (1)
280public CancellationToken CancellationToken => _context.RequestAborted;
Microsoft.AspNetCore.StaticFiles (2)
StaticFileContext.cs (2)
356await _context.Response.SendFileAsync(_fileInfo, 0, _length, _context.RequestAborted); 389await _context.Response.SendFileAsync(_fileInfo, start, length, _context.RequestAborted);
Microsoft.AspNetCore.Watch.BrowserRefresh (1)
src\sdk\src\Dotnet.Watch\Web.Middleware\BrowserScriptMiddleware.cs (1)
43await context.Response.Body.WriteAsync(_scriptBytes, context.RequestAborted);
Microsoft.DotNet.HotReload.Watch (3)
src\sdk\src\Dotnet.Watch\AspireService\AspireServerService.cs (1)
296_socketConnectionManager.AddSocketConnection(webSocket, socketTcs, context.GetDcpId(), context.RequestAborted);
src\sdk\src\Dotnet.Watch\HotReloadClient\WebSocketClientTransport.cs (2)
157await Task.Delay(Timeout.InfiniteTimeSpan, context.RequestAborted); 159catch (OperationCanceledException) when (context.RequestAborted.IsCancellationRequested)