This repository was archived by the owner on Jul 9, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
src/Titanium.Web.Proxy/EventArguments Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -94,12 +94,14 @@ private async Task readRequestBodyAsync(CancellationToken cancellationToken)
94
94
if ( request . HttpVersion == HttpHeader . Version20 )
95
95
{
96
96
request . Http2BodyData = new MemoryStream ( ) ;
97
- request . ReadHttp2BodyTaskCompletionSource = new TaskCompletionSource < bool > ( ) ;
97
+
98
+ var tcs = new TaskCompletionSource < bool > ( ) ;
99
+ request . ReadHttp2BodyTaskCompletionSource = tcs ;
98
100
99
101
// signal to HTTP/2 copy frame method to continue
100
102
ReadHttp2BodyTaskCompletionSource . SetResult ( true ) ;
101
103
102
- await request . ReadHttp2BodyTaskCompletionSource . Task ;
104
+ await tcs . Task ;
103
105
}
104
106
else
105
107
{
@@ -158,12 +160,14 @@ private async Task readResponseBodyAsync(CancellationToken cancellationToken)
158
160
if ( response . HttpVersion == HttpHeader . Version20 )
159
161
{
160
162
response . Http2BodyData = new MemoryStream ( ) ;
161
- response . ReadHttp2BodyTaskCompletionSource = new TaskCompletionSource < bool > ( ) ;
163
+
164
+ var tcs = new TaskCompletionSource < bool > ( ) ;
165
+ response . ReadHttp2BodyTaskCompletionSource = tcs ;
162
166
163
167
// signal to HTTP/2 copy frame method to continue
164
168
ReadHttp2BodyTaskCompletionSource . SetResult ( true ) ;
165
169
166
- await response . ReadHttp2BodyTaskCompletionSource . Task ;
170
+ await tcs . Task ;
167
171
}
168
172
else
169
173
{
You can’t perform that action at this time.
0 commit comments