Skip to content

Commit

Permalink
fix QuicRecvBufferHasUnreadData
Browse files Browse the repository at this point in the history
  • Loading branch information
ami-GS committed Jul 8, 2024
1 parent 7246587 commit 2fcb778
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/core/recv_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ QuicRecvBufferHasUnreadData(
_In_ QUIC_RECV_BUFFER* RecvBuffer
)
{
if (RecvBuffer->ReadPendingLength != 0 && RecvBuffer->RecvMode != QUIC_RECV_BUF_MODE_MULTIPLE) {
return FALSE;

Check warning on line 158 in src/core/recv_buffer.c

View check run for this annotation

Codecov / codecov/patch

src/core/recv_buffer.c#L158

Added line #L158 was not covered by tests
}
const QUIC_SUBRANGE* FirstRange = QuicRangeGetSafe(&RecvBuffer->WrittenRanges, 0);
if (FirstRange == NULL || FirstRange->Low != 0) {
return FALSE;
Expand Down
6 changes: 1 addition & 5 deletions src/tools/spin/spinquic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1026,11 +1026,7 @@ void Spin(Gbs& Gb, LockableVector<HQUIC>& Connections, std::vector<HQUIC>* Liste
std::lock_guard<std::mutex> Lock(ctx->Lock);
auto Stream = ctx->TryGetStream();
if (Stream == nullptr) continue;
auto StreamCtx = SpinQuicStream::Get(Stream);
bool Enable = GetRandom(2) == 0;
if (!Enable || StreamCtx->PendingRecvLength == UINT64_MAX) {
MsQuic.StreamReceiveSetEnabled(Stream, Enable);
}
MsQuic.StreamReceiveSetEnabled(Stream, GetRandom(2) == 0);
}
break;
}
Expand Down

0 comments on commit 2fcb778

Please sign in to comment.