mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-11-04 17:27:23 -05:00
fix applied wrong name, and wrong varible name
This commit is contained in:
parent
aaa9e788e7
commit
971eddaa12
@ -43,7 +43,7 @@ func (l Listener) Addr() net.Addr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Listen(ctx context.Context, address net.Address, port net.Port, settings *internet.MemoryStreamConfig, handler internet.ConnHandler) (internet.Listener, error) {
|
func Listen(ctx context.Context, address net.Address, port net.Port, settings *internet.MemoryStreamConfig, handler internet.ConnHandler) (internet.Listener, error) {
|
||||||
httpSettings := settings.ProtocolSettings.(*Config)
|
grpcSettings := settings.ProtocolSettings.(*Config)
|
||||||
var listener *Listener
|
var listener *Listener
|
||||||
if port == net.Port(0) { // unix
|
if port == net.Port(0) { // unix
|
||||||
listener = &Listener{
|
listener = &Listener{
|
||||||
@ -52,7 +52,7 @@ func Listen(ctx context.Context, address net.Address, port net.Port, settings *i
|
|||||||
Name: address.Domain(),
|
Name: address.Domain(),
|
||||||
Net: "unix",
|
Net: "unix",
|
||||||
},
|
},
|
||||||
config: httpSettings,
|
config: grpcSettings,
|
||||||
}
|
}
|
||||||
} else { // tcp
|
} else { // tcp
|
||||||
listener = &Listener{
|
listener = &Listener{
|
||||||
@ -61,7 +61,7 @@ func Listen(ctx context.Context, address net.Address, port net.Port, settings *i
|
|||||||
IP: address.IP(),
|
IP: address.IP(),
|
||||||
Port: int(port),
|
Port: int(port),
|
||||||
},
|
},
|
||||||
config: httpSettings,
|
config: grpcSettings,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ func Listen(ctx context.Context, address net.Address, port net.Port, settings *i
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
encoding.RegisterGunServiceServerX(s, listener, config.ServerName)
|
encoding.RegisterGunServiceServerX(s, listener, grpcSettings.ServiceName)
|
||||||
|
|
||||||
if err = s.Serve(streamListener); err != nil {
|
if err = s.Serve(streamListener); err != nil {
|
||||||
newError("Listener for grpc ended").Base(err).WriteToLog()
|
newError("Listener for grpc ended").Base(err).WriteToLog()
|
||||||
|
Loading…
Reference in New Issue
Block a user