Skip to content

Commit a7efcd9

Browse files
authored
Update readAheadTask asserts (#104496)
1 parent aee78d3 commit a7efcd9

File tree

1 file changed

+2
-2
lines changed
  • src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler

1 file changed

+2
-2
lines changed

src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnection.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ public async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, boo
607607
// meaning that PrepareForReuse would have failed, and we wouldn't have called SendAsync.
608608
// The task therefore shouldn't be 'default', as it's representing an async operation that had to yield at some point.
609609
Debug.Assert(_readAheadTask != default);
610-
Debug.Assert(_readAheadTaskStatus == ReadAheadTask_CompletionReserved);
610+
Debug.Assert(_readAheadTaskStatus is ReadAheadTask_CompletionReserved or ReadAheadTask_Completed);
611611

612612
// Handle the pre-emptive read. For the async==false case, hopefully the read has
613613
// already completed and this will be a nop, but if it hasn't, the caller will be forced to block
@@ -852,7 +852,7 @@ public async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, boo
852852

853853
if (_readAheadTask != default)
854854
{
855-
Debug.Assert(_readAheadTaskStatus == ReadAheadTask_CompletionReserved);
855+
Debug.Assert(_readAheadTaskStatus is ReadAheadTask_CompletionReserved or ReadAheadTask_Completed);
856856

857857
LogExceptions(_readAheadTask.AsTask());
858858
}

0 commit comments

Comments
 (0)