1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-27 12:35:21 -05:00

cleanup socks log

This commit is contained in:
v2ray
2016-01-18 11:43:24 +01:00
parent 0bfe78dd6e
commit 8f20933457
3 changed files with 30 additions and 30 deletions

View File

@@ -49,7 +49,7 @@ func ReadAuthentication(reader io.Reader) (auth Socks5AuthenticationRequest, aut
return
}
if nBytes < 2 {
log.Info("Socks expected 2 bytes read, but only %d bytes read", nBytes)
log.Info("Socks: expected 2 bytes read, but only %d bytes read", nBytes)
err = transport.CorruptedPacket
return
}
@@ -65,20 +65,20 @@ func ReadAuthentication(reader io.Reader) (auth Socks5AuthenticationRequest, aut
auth.version = buffer.Value[0]
if auth.version != socksVersion {
log.Warning("Unknown protocol version %d", auth.version)
log.Warning("Socks: Unknown protocol version %d", auth.version)
err = proxy.InvalidProtocolVersion
return
}
auth.nMethods = buffer.Value[1]
if auth.nMethods <= 0 {
log.Info("Zero length of authentication methods")
log.Info("Socks: Zero length of authentication methods")
err = transport.CorruptedPacket
return
}
if nBytes-2 != int(auth.nMethods) {
log.Info("Unmatching number of auth methods, expecting %d, but got %d", auth.nMethods, nBytes)
log.Info("Socks: Unmatching number of auth methods, expecting %d, but got %d", auth.nMethods, nBytes)
err = transport.CorruptedPacket
return
}
@@ -227,7 +227,7 @@ func ReadRequest(reader io.Reader) (request *Socks5Request, err error) {
}
if nBytes != int(domainLength) {
log.Info("Unable to read domain with %d bytes, expecting %d bytes", nBytes, domainLength)
log.Info("Socks: Unable to read domain with %d bytes, expecting %d bytes", nBytes, domainLength)
err = transport.CorruptedPacket
return
}
@@ -242,7 +242,7 @@ func ReadRequest(reader io.Reader) (request *Socks5Request, err error) {
return
}
default:
log.Info("Unexpected address type %d", request.AddrType)
log.Info("Socks: Unexpected address type %d", request.AddrType)
err = transport.CorruptedPacket
return
}