1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-24 19:16:55 -05:00

Fix bug incorrect config parse in VLite inbound

This commit is contained in:
Shelikhoo 2022-04-21 21:52:04 +01:00 committed by Xiaokang Wang (Shelikhoo)
parent 87090bf408
commit 8a3e90c11f

View File

@ -107,7 +107,7 @@ func (s *status) Connection(conn gonet.Conn, connctx context.Context) context.Co
}(connctx) }(connctx)
if s.config.EnableStabilization && s.config.EnableRenegotiation { if !s.config.EnableStabilization || !s.config.EnableRenegotiation {
relay := udpsctpserver.NewPacketRelayServer(conn, S_S2CTraffic2, S_S2CDataTraffic2, S_C2STraffic2, s, s.password, connctx) relay := udpsctpserver.NewPacketRelayServer(conn, S_S2CTraffic2, S_S2CDataTraffic2, S_C2STraffic2, s, s.password, connctx)
udpserver := server.UDPServer(connctx, S_S2CTraffic, S_S2CDataTraffic, S_C2STraffic, relay) udpserver := server.UDPServer(connctx, S_S2CTraffic, S_S2CDataTraffic, S_C2STraffic, relay)
_ = udpserver _ = udpserver
@ -117,7 +117,7 @@ func (s *status) Connection(conn gonet.Conn, connctx context.Context) context.Co
udpserver := server.UDPServer(connctx, S_S2CTraffic, S_S2CDataTraffic, S_C2STraffic, relay) udpserver := server.UDPServer(connctx, S_S2CTraffic, S_S2CDataTraffic, S_C2STraffic, relay)
_ = udpserver _ = udpserver
} }
return nil return connctx
} }
func createStatusFromConfig(config *UDPProtocolConfig) (*status, error) { func createStatusFromConfig(config *UDPProtocolConfig) (*status, error) {
@ -151,7 +151,9 @@ func enableInterface(s *status) error {
if s.config.EnableStabilization { if s.config.EnableStabilization {
s.transport = uniserver.NewUnifiedConnectionTransportHub(s, s.ctx) s.transport = uniserver.NewUnifiedConnectionTransportHub(s, s.ctx)
} }
if s.config.EnableStabilization {
s.transport = udpunis.NewUdpUniServer(string(s.password), s.ctx, s.transport) s.transport = udpunis.NewUdpUniServer(string(s.password), s.ctx, s.transport)
}
return nil return nil
} }