mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-10-11 08:35:47 +00:00
Improve bridge
This commit is contained in:
+18
-9
@@ -326,17 +326,26 @@ func (t *Inbound) Start(stage adapter.StartStage) error {
|
||||
case adapter.StartStateStart:
|
||||
if t.platformInterface == nil &&
|
||||
((C.IsLinux && !t.tunOptions.GSO) || (C.IsDarwin && !t.tunOptions.EXP_MultiPendingPackets)) {
|
||||
outboundManager := service.FromContext[adapter.OutboundManager](t.ctx)
|
||||
endpointManager := service.FromContext[adapter.EndpointManager](t.ctx)
|
||||
if endpointManager != nil {
|
||||
for _, managedEndpoint := range endpointManager.Endpoints() {
|
||||
if _, isFlowOutbound := managedEndpoint.(adapter.FlowOutbound); isFlowOutbound {
|
||||
if C.IsLinux {
|
||||
t.tunOptions.GSO = true
|
||||
} else {
|
||||
t.tunOptions.EXP_MultiPendingPackets = true
|
||||
}
|
||||
break
|
||||
for _, outbound := range outboundManager.Outbounds() {
|
||||
if _, isFlowOutbound := outbound.(adapter.FlowOutbound); isFlowOutbound {
|
||||
if C.IsLinux {
|
||||
t.tunOptions.GSO = true
|
||||
} else {
|
||||
t.tunOptions.EXP_MultiPendingPackets = true
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
for _, endpoint := range endpointManager.Endpoints() {
|
||||
if _, isFlowOutbound := endpoint.(adapter.FlowOutbound); isFlowOutbound {
|
||||
if C.IsLinux {
|
||||
t.tunOptions.GSO = true
|
||||
} else {
|
||||
t.tunOptions.EXP_MultiPendingPackets = true
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user