Skip to content

Commit

Permalink
update 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 ddb7d2e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 4 additions & 0 deletions src/core/recv_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ QuicRecvBufferHasUnreadData(
_In_ QUIC_RECV_BUFFER* RecvBuffer
)
{
if (RecvBuffer->ReadPendingLength != 0 && RecvBuffer->RecvMode != QUIC_RECV_BUF_MODE_MULTIPLE) {
fprintf(stderr, "QuicRecvBufferHasUnreadData: RecvBuffer->ReadPendingLength = %lu\n", RecvBuffer->ReadPendingLength);
return FALSE;
}
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 ddb7d2e

Please sign in to comment.