1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-30 05:56:54 -05:00

Lazy initialize of socks5 response

This commit is contained in:
V2Ray 2015-10-13 22:00:03 +02:00
parent 7cc8d90f26
commit 8c5865d4e7

View File

@ -134,7 +134,6 @@ func (server *SocksServer) handleSocks5(reader *v2net.TimeOutReader, writer io.W
return server.handleUDP(reader, writer)
}
response := protocol.NewSocks5Response()
if request.Command == protocol.CmdBind || request.Command == protocol.CmdUdpAssociate {
response := protocol.NewSocks5Response()
response.Error = protocol.ErrorCommandNotSupported
@ -151,6 +150,7 @@ func (server *SocksServer) handleSocks5(reader *v2net.TimeOutReader, writer io.W
return UnsupportedSocksCommand
}
response := protocol.NewSocks5Response()
response.Error = protocol.ErrorSuccess
// Some SOCKS software requires a value other than dest. Let's fake one: