mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-20 07:04:08 +00:00
BytesLiteral.String
This commit is contained in:
1 parent
4dd771170c
commit
65d5c07533
3 files changed
+8
-2
No files matched your search
@@ -9,6 +9,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/v2ray/v2ray-core/common/log"
|
||||
"github.com/v2ray/v2ray-core/common/serial"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -20,7 +21,7 @@ func (this *PortRange) UnmarshalJSON(data []byte) error {
|
||||
err := json.Unmarshal(data, &maybeint)
|
||||
if err == nil {
|
||||
if maybeint <= 0 || maybeint >= 65535 {
|
||||
log.Error("Invalid port [", string(data), "]")
|
||||
log.Error("Invalid port [", serial.BytesLiteral(data), "]")
|
||||
return InvalidPortRange
|
||||
}
|
||||
this.From = Port(maybeint)
|
||||
|
||||
Reference in new issue
Block a user