mirror of
https://github.com/nadoo/glider.git
synced 2026-11-19 07:09:42 +08:00
ss: handle unexpect situation to avoid panic #132
This commit is contained in:
1 parent
4e1cb6ebf6
commit
2520a1c8b4
7 files changed
+33
-16
No files matched your search
@@ -27,8 +27,12 @@ const (
|
||||
ATypIP6 = 4
|
||||
)
|
||||
|
||||
// MaxAddrLen is the maximum size of SOCKS address in bytes.
|
||||
const MaxAddrLen = 1 + 1 + 255 + 2
|
||||
const (
|
||||
// maximum size of SOCKS address in bytes.
|
||||
MaxAddrLen = 1 + 1 + 255 + 2
|
||||
// minimum size of SOCKS address in bytes.
|
||||
MinAddrLen = 5
|
||||
)
|
||||
|
||||
// Errors are socks5 errors
|
||||
var Errors = []error{
|
||||
@@ -129,7 +133,6 @@ func SplitAddr(b []byte) Addr {
|
||||
addrLen = 1 + net.IPv6len + 2
|
||||
default:
|
||||
return nil
|
||||
|
||||
}
|
||||
|
||||
if len(b) < addrLen {
|
||||
|
||||
Reference in new issue
Block a user