Skip to content

Commit e709b03

Browse files
author
ladeak
committed
Align priority levels for WriteEndStream and WriteTrailers
The priority levels for scheduling `WriteEndStream` and `WriteTrailers` in the `ChannelsPriorityResponseWriter` class have been adjusted to match the priority level of `WriteData` (+20). Previously, `WriteEndStream` and `WriteTrailers` had higher priority levels (+60 and +40, respectively). This change ensures these operations are written after all `DATA` but with the same priority. Comments were added to clarify this behavior.
1 parent 1705130 commit e709b03

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/CHttpServer/CHttpServer/ChannelsPriorityResponseWriter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ public void ScheduleWriteData(Http2Stream source) =>
105105
_channel.Writer.TryWrite(new ChannelStreamWriteRequest(source, WriteData, GetPriorityLevel(source) + 20));
106106

107107
public void ScheduleEndStream(Http2Stream source) =>
108-
_channel.Writer.TryWrite(new ChannelStreamWriteRequest(source, WriteEndStream, GetPriorityLevel(source) + 60));
108+
_channel.Writer.TryWrite(new ChannelStreamWriteRequest(source, WriteEndStream, GetPriorityLevel(source) + 20)); // Written after all DATA, can use the same priority
109109

110110
public void ScheduleWriteTrailers(Http2Stream source) =>
111-
_channel.Writer.TryWrite(new ChannelStreamWriteRequest(source, WriteTrailers, GetPriorityLevel(source) + 40));
111+
_channel.Writer.TryWrite(new ChannelStreamWriteRequest(source, WriteTrailers, GetPriorityLevel(source) + 20)); // Written after all DATA, can use the same priority
112112

113113
public void ScheduleWriteWindowUpdate(Http2Stream source, uint size) =>
114114
_channel.Writer.TryWrite(new ChannelStreamWriteRequest(source, WriteWindowUpdate, 1, size));

0 commit comments

Comments
 (0)