Fix for missing returns.
This commit is contained in:
parent
c19db44edd
commit
34cbbcc6a8
3
socks.go
3
socks.go
@ -88,8 +88,10 @@ func dialSocks5(proxy, targetAddr string) (conn net.Conn, err error) {
|
|||||||
return
|
return
|
||||||
} else if len(resp) != 2 {
|
} else if len(resp) != 2 {
|
||||||
err = errors.New("Server does not respond properly.")
|
err = errors.New("Server does not respond properly.")
|
||||||
|
return
|
||||||
} else if resp[0] != 5 {
|
} else if resp[0] != 5 {
|
||||||
err = errors.New("Server does not support Socks 5.")
|
err = errors.New("Server does not support Socks 5.")
|
||||||
|
return
|
||||||
} else if resp[1] != 0 { // no auth
|
} else if resp[1] != 0 { // no auth
|
||||||
err = errors.New("socks method negotiation failed.")
|
err = errors.New("socks method negotiation failed.")
|
||||||
return
|
return
|
||||||
@ -157,6 +159,7 @@ func dialSocks4(socksType int, proxy, targetAddr string) (conn net.Conn, err err
|
|||||||
return
|
return
|
||||||
} else if len(resp) != 8 {
|
} else if len(resp) != 8 {
|
||||||
err = errors.New("Server does not respond properly.")
|
err = errors.New("Server does not respond properly.")
|
||||||
|
return
|
||||||
}
|
}
|
||||||
switch resp[1] {
|
switch resp[1] {
|
||||||
case 90:
|
case 90:
|
||||||
|
Loading…
Reference in New Issue
Block a user