diff --git a/src/Microsoft.AspNetCore.Server.Kestrel/Internal/Http/ListenerSecondary.cs b/src/Microsoft.AspNetCore.Server.Kestrel/Internal/Http/ListenerSecondary.cs index 41de1df45c..331e1bc4f3 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel/Internal/Http/ListenerSecondary.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel/Internal/Http/ListenerSecondary.cs @@ -109,13 +109,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http { req.Dispose(); + var innerTcs = (TaskCompletionSource)state; if (ex != null) { - tcs.SetException(ex); + innerTcs.SetException(ex); } else { - tcs.SetResult(0); + innerTcs.SetResult(0); } }, tcs);