Update inbound.go

pull/5101/head
RPRX 2025-09-09 14:06:33 +00:00 committed by GitHub
parent 6417c77181
commit 8c4e998ca0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 3 deletions

View File

@ -197,7 +197,9 @@ func (h *Handler) GetReverse(a *vless.MemoryAccount) (*Reverse, error) {
if r == nil { if r == nil {
picker, _ := reverse.NewStaticMuxPicker() picker, _ := reverse.NewStaticMuxPicker()
r = &Reverse{tag: a.Reverse.Tag, picker: picker, client: &mux.ClientManager{Picker: picker}} r = &Reverse{tag: a.Reverse.Tag, picker: picker, client: &mux.ClientManager{Picker: picker}}
for len(h.outboundHandlerManager.ListHandlers(h.ctx)) == 0 {
runtime.Gosched() // prevents this outbound from becoming the default outbound runtime.Gosched() // prevents this outbound from becoming the default outbound
}
if err := h.outboundHandlerManager.AddHandler(h.ctx, r); err != nil { if err := h.outboundHandlerManager.AddHandler(h.ctx, r); err != nil {
return nil, err return nil, err
} }
@ -547,9 +549,8 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection s
switch request.Command { switch request.Command {
case protocol.RequestCommandUDP: case protocol.RequestCommandUDP:
return errors.New(requestAddons.Flow + " doesn't support UDP").AtWarning() return errors.New(requestAddons.Flow + " doesn't support UDP").AtWarning()
case protocol.RequestCommandRvs: case protocol.RequestCommandMux, protocol.RequestCommandRvs:
inbound.CanSpliceCopy = 3 inbound.CanSpliceCopy = 3
case protocol.RequestCommandMux:
fallthrough // we will break Mux connections that contain TCP requests fallthrough // we will break Mux connections that contain TCP requests
case protocol.RequestCommandTCP: case protocol.RequestCommandTCP:
var t reflect.Type var t reflect.Type