@@ -75,7 +75,7 @@ public override async ValueTask DisposeAsync()
75
75
// Dispose the connection
76
76
// If we already waited for graceful shutdown from the client, then the connection is already closed and this will simply release the handle.
77
77
// If not, then this will silently abort the connection.
78
- await _connection . DisposeAsync ( ) ;
78
+ await _connection . DisposeAsync ( ) . ConfigureAwait ( false ) ;
79
79
80
80
// Dispose control streams so that we release their handles too.
81
81
if ( _inboundControlStream is not null )
@@ -92,12 +92,12 @@ public override async ValueTask DisposeAsync()
92
92
93
93
public async ValueTask < Http3LoopbackStream > OpenUnidirectionalStreamAsync ( )
94
94
{
95
- return new Http3LoopbackStream ( await _connection . OpenOutboundStreamAsync ( QuicStreamType . Unidirectional ) ) ;
95
+ return new Http3LoopbackStream ( await _connection . OpenOutboundStreamAsync ( QuicStreamType . Unidirectional ) . ConfigureAwait ( false ) ) ;
96
96
}
97
97
98
98
public async ValueTask < Http3LoopbackStream > OpenBidirectionalStreamAsync ( )
99
99
{
100
- return new Http3LoopbackStream ( await _connection . OpenOutboundStreamAsync ( QuicStreamType . Bidirectional ) ) ;
100
+ return new Http3LoopbackStream ( await _connection . OpenOutboundStreamAsync ( QuicStreamType . Bidirectional ) . ConfigureAwait ( false ) ) ;
101
101
}
102
102
103
103
public static int GetRequestId ( QuicStream stream )
@@ -141,10 +141,10 @@ async Task EnsureControlStreamAcceptedInternalAsync()
141
141
_delayedStreams . Enqueue ( quicStream ) ;
142
142
}
143
143
144
- long ? streamType = await controlStream . ReadIntegerAsync ( ) ;
144
+ long ? streamType = await controlStream . ReadIntegerAsync ( ) . ConfigureAwait ( false ) ;
145
145
Assert . Equal ( Http3LoopbackStream . ControlStream , streamType ) ;
146
146
147
- List < ( long settingId , long settingValue ) > settings = await controlStream . ReadSettingsAsync ( ) ;
147
+ List < ( long settingId , long settingValue ) > settings = await controlStream . ReadSettingsAsync ( ) . ConfigureAwait ( false ) ;
148
148
( long settingId , long settingValue ) = Assert . Single ( settings ) ;
149
149
150
150
Assert . Equal ( Http3LoopbackStream . MaxHeaderListSize , settingId ) ;
@@ -177,17 +177,17 @@ public async Task<Http3LoopbackStream> AcceptRequestStreamAsync()
177
177
178
178
public async Task < ( Http3LoopbackStream clientControlStream , Http3LoopbackStream requestStream ) > AcceptControlAndRequestStreamAsync ( )
179
179
{
180
- Http3LoopbackStream requestStream = await AcceptRequestStreamAsync ( ) ;
180
+ Http3LoopbackStream requestStream = await AcceptRequestStreamAsync ( ) . ConfigureAwait ( false ) ;
181
181
Http3LoopbackStream controlStream = _inboundControlStream ;
182
182
183
183
return ( controlStream , requestStream ) ;
184
184
}
185
185
186
186
public async Task EstablishControlStreamAsync ( SettingsEntry [ ] settingsEntries )
187
187
{
188
- _outboundControlStream = await OpenUnidirectionalStreamAsync ( ) ;
189
- await _outboundControlStream . SendUnidirectionalStreamTypeAsync ( Http3LoopbackStream . ControlStream ) ;
190
- await _outboundControlStream . SendSettingsFrameAsync ( settingsEntries ) ;
188
+ _outboundControlStream = await OpenUnidirectionalStreamAsync ( ) . ConfigureAwait ( false ) ;
189
+ await _outboundControlStream . SendUnidirectionalStreamTypeAsync ( Http3LoopbackStream . ControlStream ) . ConfigureAwait ( false ) ;
190
+ await _outboundControlStream . SendSettingsFrameAsync ( settingsEntries ) . ConfigureAwait ( false ) ;
191
191
}
192
192
193
193
public async Task DisposeCurrentStream ( )
@@ -213,7 +213,7 @@ public override async Task<HttpRequestData> ReadRequestDataAsync(bool readBody =
213
213
214
214
public override async Task SendResponseAsync ( HttpStatusCode statusCode = HttpStatusCode . OK , IList < HttpHeaderData > headers = null , string content = "" , bool isFinal = true )
215
215
{
216
- await _currentStream . SendResponseAsync ( statusCode , headers , content , isFinal ) ;
216
+ await _currentStream . SendResponseAsync ( statusCode , headers , content , isFinal ) . ConfigureAwait ( false ) ;
217
217
if ( isFinal )
218
218
{
219
219
await DisposeCurrentStream ( ) . ConfigureAwait ( false ) ;
@@ -222,7 +222,7 @@ public override async Task SendResponseAsync(HttpStatusCode statusCode = HttpSta
222
222
223
223
public override async Task SendResponseBodyAsync ( byte [ ] content , bool isFinal = true )
224
224
{
225
- await _currentStream . SendResponseBodyAsync ( content , isFinal ) ;
225
+ await _currentStream . SendResponseBodyAsync ( content , isFinal ) . ConfigureAwait ( false ) ;
226
226
if ( isFinal )
227
227
{
228
228
await DisposeCurrentStream ( ) . ConfigureAwait ( false ) ;
@@ -249,11 +249,11 @@ public override async Task<HttpRequestData> HandleRequestAsync(HttpStatusCode st
249
249
// So, send a GOAWAY frame now so the client won't inadvertantly try to reuse the connection.
250
250
// Note that in HTTP3 (unlike HTTP2) there is no strict ordering between the GOAWAY and the response below;
251
251
// so the client may race in processing them and we need to handle this.
252
- await _outboundControlStream . SendGoAwayFrameAsync ( stream . StreamId + 4 ) ;
252
+ await _outboundControlStream . SendGoAwayFrameAsync ( stream . StreamId + 4 ) . ConfigureAwait ( false ) ;
253
253
254
254
await stream . SendResponseAsync ( statusCode , headers , content ) . ConfigureAwait ( false ) ;
255
255
256
- await WaitForClientDisconnectAsync ( ) ;
256
+ await WaitForClientDisconnectAsync ( ) . ConfigureAwait ( false ) ;
257
257
258
258
return request ;
259
259
}
@@ -263,7 +263,7 @@ public async Task ShutdownAsync(bool failCurrentRequest = false)
263
263
try
264
264
{
265
265
long firstInvalidStreamId = failCurrentRequest ? _currentStreamId : _currentStreamId + 4 ;
266
- await _outboundControlStream . SendGoAwayFrameAsync ( firstInvalidStreamId ) ;
266
+ await _outboundControlStream . SendGoAwayFrameAsync ( firstInvalidStreamId ) . ConfigureAwait ( false ) ;
267
267
}
268
268
catch ( QuicException abortException ) when ( abortException . QuicError == QuicError . ConnectionAborted && abortException . ApplicationErrorCode == H3_NO_ERROR )
269
269
{
@@ -283,7 +283,7 @@ public async Task ShutdownAsync(bool failCurrentRequest = false)
283
283
return ;
284
284
}
285
285
286
- await WaitForClientDisconnectAsync ( ) ;
286
+ await WaitForClientDisconnectAsync ( ) . ConfigureAwait ( false ) ;
287
287
}
288
288
289
289
// Wait for the client to close the connection, e.g. after we send a GOAWAY, or after the HttpClient is disposed.
@@ -315,10 +315,10 @@ public async Task WaitForClientDisconnectAsync(bool refuseNewRequests = true)
315
315
316
316
// The client's control stream should throw QuicConnectionAbortedException, indicating that it was
317
317
// aborted because the connection was closed (and was not explicitly closed or aborted prior to the connection being closed)
318
- QuicException ex = await Assert . ThrowsAsync < QuicException > ( async ( ) => await _inboundControlStream . ReadFrameAsync ( ) ) ;
318
+ QuicException ex = await Assert . ThrowsAsync < QuicException > ( async ( ) => await _inboundControlStream . ReadFrameAsync ( ) . ConfigureAwait ( false ) ) ;
319
319
Assert . Equal ( QuicError . ConnectionAborted , ex . QuicError ) ;
320
320
321
- await CloseAsync ( H3_NO_ERROR ) ;
321
+ await CloseAsync ( H3_NO_ERROR ) . ConfigureAwait ( false ) ;
322
322
}
323
323
324
324
public override async Task WaitForCancellationAsync ( bool ignoreIncomingData = true )
0 commit comments