Remove sync block->task
await rather than synchronously blocking and then returning a Task.FromResult
This commit is contained in:
parent
0bfc97e46f
commit
344c821f83
|
|
@ -277,7 +277,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
|
||||||
OnCompleted(callback, state);
|
OnCompleted(callback, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
Task<Stream> IHttpUpgradeFeature.UpgradeAsync()
|
async Task<Stream> IHttpUpgradeFeature.UpgradeAsync()
|
||||||
{
|
{
|
||||||
StatusCode = 101;
|
StatusCode = 101;
|
||||||
ReasonPhrase = "Switching Protocols";
|
ReasonPhrase = "Switching Protocols";
|
||||||
|
|
@ -290,8 +290,10 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
|
||||||
ResponseHeaders["Upgrade"] = values;
|
ResponseHeaders["Upgrade"] = values;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ProduceStartAndFireOnStarting(immediate: true).GetAwaiter().GetResult();
|
|
||||||
return Task.FromResult(DuplexStream);
|
await ProduceStartAndFireOnStarting(immediate: true);
|
||||||
|
|
||||||
|
return DuplexStream;
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumerator<KeyValuePair<Type, object>> IEnumerable<KeyValuePair<Type, object>>.GetEnumerator() => FastEnumerable().GetEnumerator();
|
IEnumerator<KeyValuePair<Type, object>> IEnumerable<KeyValuePair<Type, object>>.GetEnumerator() => FastEnumerable().GetEnumerator();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue