Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ami-GS committed Jul 24, 2024
1 parent b41b975 commit 1964ff9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/core/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,8 @@ MsQuicStreamStart(
QUIC_STATUS Status;
QUIC_STREAM* Stream;
QUIC_CONNECTION* Connection;
BOOLEAN IsPriority = !!(Flags & QUIC_STREAM_START_FLAG_PRIORITY_WORK);
Flags &= ~QUIC_STREAM_START_FLAG_PRIORITY_WORK;

QuicTraceEvent(
ApiEnter,
Expand Down Expand Up @@ -853,7 +855,7 @@ MsQuicStreamStart(
//
// Queue the operation but don't wait for the completion.
//
if (Flags & QUIC_STREAM_START_FLAG_PRIORITY_WORK) {
if (IsPriority) {
QuicConnQueuePriorityOper(Connection, Oper);
} else {
QuicConnQueueOper(Connection, Oper);
Expand Down Expand Up @@ -1009,6 +1011,7 @@ MsQuicStreamSend(
QUIC_SEND_REQUEST* SendRequest;
BOOLEAN QueueOper = TRUE;
const BOOLEAN IsPriority = !!(Flags & QUIC_SEND_FLAG_PRIORITY_WORK);
Flags &= ~QUIC_SEND_FLAG_PRIORITY_WORK;
BOOLEAN SendInline;
QUIC_OPERATION* Oper;

Expand Down
1 change: 1 addition & 0 deletions src/core/datagram.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ QuicDatagramQueueSend(
QUIC_STATUS Status;
BOOLEAN QueueOper = TRUE;
const BOOLEAN IsPriority = !!(SendRequest->Flags & QUIC_SEND_FLAG_PRIORITY_WORK);
SendRequest->Flags &= ~QUIC_SEND_FLAG_PRIORITY_WORK;
QUIC_CONNECTION* Connection = QuicDatagramGetConnection(Datagram);

CxPlatDispatchLockAcquire(&Datagram->ApiQueueLock);
Expand Down
2 changes: 1 addition & 1 deletion src/core/operation.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ QuicOperationEnqueuePriority(
#if DEBUG
CXPLAT_DBG_ASSERT(Oper->Link.Flink == NULL);
#endif
StartProcessing = CxPlatListIsEmpty(&OperQ->List) && !OperQ->ActivelyProcessing;
StartProcessing = (&OperQ->List.Flink == OperQ->PriorityTail) && !OperQ->ActivelyProcessing;
CxPlatListInsertTail(*OperQ->PriorityTail, &Oper->Link);
OperQ->PriorityTail = &Oper->Link.Flink;
CxPlatDispatchLockRelease(&OperQ->Lock);
Expand Down

0 comments on commit 1964ff9

Please sign in to comment.