Skip to content

Commit

Permalink
Update readAheadTask asserts (dotnet#104496)
Browse files Browse the repository at this point in the history
  • Loading branch information
MihaZupan authored Jul 6, 2024
1 parent aee78d3 commit a7efcd9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ public async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, boo
// meaning that PrepareForReuse would have failed, and we wouldn't have called SendAsync.
// The task therefore shouldn't be 'default', as it's representing an async operation that had to yield at some point.
Debug.Assert(_readAheadTask != default);
Debug.Assert(_readAheadTaskStatus == ReadAheadTask_CompletionReserved);
Debug.Assert(_readAheadTaskStatus is ReadAheadTask_CompletionReserved or ReadAheadTask_Completed);

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

if (_readAheadTask != default)
{
Debug.Assert(_readAheadTaskStatus == ReadAheadTask_CompletionReserved);
Debug.Assert(_readAheadTaskStatus is ReadAheadTask_CompletionReserved or ReadAheadTask_Completed);

LogExceptions(_readAheadTask.AsTask());
}
Expand Down

0 comments on commit a7efcd9

Please sign in to comment.