Follow common pattern for implementing IHttpRequestLifetimeFeature
This commit is contained in:
parent
b73e42b617
commit
f7a5c38f65
|
|
@ -231,6 +231,18 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
|
|||
}
|
||||
}
|
||||
|
||||
CancellationToken IHttpRequestLifetimeFeature.RequestAborted
|
||||
{
|
||||
get
|
||||
{
|
||||
return RequestAborted;
|
||||
}
|
||||
set
|
||||
{
|
||||
RequestAborted = value;
|
||||
}
|
||||
}
|
||||
|
||||
bool IHttpResponseFeature.HasStarted
|
||||
{
|
||||
get { return HasResponseStarted; }
|
||||
|
|
@ -263,8 +275,6 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
|
|||
|
||||
bool IHttpConnectionFeature.IsLocal { get; set; }
|
||||
|
||||
CancellationToken IHttpRequestLifetimeFeature.RequestAborted { get; set; }
|
||||
|
||||
object IFeatureCollection.this[Type key]
|
||||
{
|
||||
get { return FastFeatureGet(key); }
|
||||
|
|
|
|||
|
|
@ -89,6 +89,8 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
|
|||
|
||||
public Stream DuplexStream { get; set; }
|
||||
|
||||
public CancellationToken RequestAborted { get; set; }
|
||||
|
||||
public bool HasResponseStarted
|
||||
{
|
||||
get { return _responseStarted; }
|
||||
|
|
@ -241,7 +243,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
|
|||
DuplexStream = new FrameDuplexStream(RequestBody, ResponseBody);
|
||||
|
||||
_requestAbortCts = CancellationTokenSource.CreateLinkedTokenSource(_disconnectCts.Token);
|
||||
((IHttpRequestLifetimeFeature)this).RequestAborted = _requestAbortCts.Token;
|
||||
RequestAborted = _requestAbortCts.Token;
|
||||
|
||||
var httpContext = HttpContextFactory.Create(this);
|
||||
try
|
||||
|
|
|
|||
Loading…
Reference in New Issue