Skip to content
This repository has been archived by the owner on Mar 29, 2024. It is now read-only.

Always mark System DNS Client packets as high priority #193

Merged
merged 1 commit into from
Mar 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions crew/op_connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ type ConnectRequest struct {
Domain string `json:"d,omitempty"`
IP net.IP `json:"ip,omitempty"`
UsePriorityDataMsgs bool `json:"pr,omitempty"`
AlwaysHighPriority bool `json:"hp,omitempty"`
Protocol packet.IPProtocol `json:"p,omitempty"`
Port uint16 `json:"po,omitempty"`
QueueSize uint32 `json:"qs,omitempty"`
Expand Down Expand Up @@ -125,6 +126,7 @@ func NewConnectOp(tunnel *Tunnel) (*ConnectOp, *terminal.Error) {
Protocol: packet.IPProtocol(tunnel.connInfo.Entity.Protocol),
Port: tunnel.connInfo.Entity.Port,
UsePriorityDataMsgs: terminal.UsePriorityDataMsgs,
AlwaysHighPriority: tunnel.connInfo.Process().IsSystemResolver(),
}

// Set defaults.
Expand Down Expand Up @@ -379,6 +381,8 @@ func (op *ConnectOp) connReader(_ context.Context) error {

// Define priority and possibly wait for slot.
switch {
case op.request.AlwaysHighPriority && op.request.UsePriorityDataMsgs:
msg.Unit.MakeHighPriority()
case inBytes > highPrioThreshold:
msg.Unit.WaitForSlot()
case op.request.UsePriorityDataMsgs:
Expand Down
Loading