@@ -121,27 +121,20 @@ internal async ValueTask<Http3ControlStream> GetInboundControlStream()
121121 {
122122 if ( _inboundControlStream == null )
123123 {
124- return await CreateNewInboundControlStream ( ) ;
125- }
126-
127- return null ;
128- }
129-
130- internal async ValueTask < Http3ControlStream > CreateNewInboundControlStream ( )
131- {
132- var reader = MultiplexedConnectionContext . ToClientAcceptQueue . Reader ;
133- while ( await reader . WaitToReadAsync ( ) )
134- {
135- while ( reader . TryRead ( out var stream ) )
124+ var reader = MultiplexedConnectionContext . ToClientAcceptQueue . Reader ;
125+ while ( await reader . WaitToReadAsync ( ) )
136126 {
137- _inboundControlStream = stream ;
138- var streamId = await stream . TryReadStreamIdAsync ( ) ;
139- Debug . Assert ( streamId == 0 , "StreamId sent that was non-zero, which isn't handled by tests" ) ;
140- return _inboundControlStream ;
127+ while ( reader . TryRead ( out var stream ) )
128+ {
129+ _inboundControlStream = stream ;
130+ var streamId = await stream . TryReadStreamIdAsync ( ) ;
131+ Debug . Assert ( streamId == 0 , "StreamId sent that was non-zero, which isn't handled by tests" ) ;
132+ return _inboundControlStream ;
133+ }
141134 }
142135 }
143136
144- throw new InvalidOperationException ( "Should never reach here." ) ;
137+ return null ;
145138 }
146139
147140 internal async Task WaitForConnectionErrorAsync < TException > ( bool ignoreNonGoAwayFrames , long expectedLastStreamId , Http3ErrorCode expectedErrorCode , params string [ ] expectedErrorMessage )
@@ -464,21 +457,12 @@ internal async Task WaitForStreamErrorAsync(Http3ErrorCode protocolError, string
464457 _testBase . Logger . LogTrace ( "Input is completed" ) ;
465458
466459 Assert . True ( readResult . IsCompleted ) ;
467- //try
468- {
469- Assert . Equal ( protocolError , ( Http3ErrorCode ) Error ) ;
460+ Assert . Equal ( protocolError , ( Http3ErrorCode ) Error ) ;
470461
471- if ( expectedErrorMessage != null )
472- {
473- Assert . Contains ( _testBase . LogMessages , m => m . Exception ? . Message . Contains ( expectedErrorMessage ) ?? false ) ;
474- }
462+ if ( expectedErrorMessage != null )
463+ {
464+ Assert . Contains ( _testBase . LogMessages , m => m . Exception ? . Message . Contains ( expectedErrorMessage ) ?? false ) ;
475465 }
476- //catch (Exception ex)
477- //{
478- // Debugger.Launch();
479- // string s = ex.Message;
480- // throw;
481- //}
482466 }
483467 }
484468
0 commit comments