Skip to content

Commit

Permalink
Merge pull request #5 from Alekc/bugfix
Browse files Browse the repository at this point in the history
Fix for missing returns.
  • Loading branch information
Hǎiliàng Wáng committed Feb 15, 2016
2 parents c19db44 + a68bd16 commit 6e16ba9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions socks.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,10 @@ func dialSocks5(proxy, targetAddr string) (conn net.Conn, err error) {
return
} else if len(resp) != 2 {
err = errors.New("Server does not respond properly.")
return
} else if resp[0] != 5 {
err = errors.New("Server does not support Socks 5.")
return
} else if resp[1] != 0 { // no auth
err = errors.New("socks method negotiation failed.")
return
Expand Down Expand Up @@ -157,6 +159,7 @@ func dialSocks4(socksType int, proxy, targetAddr string) (conn net.Conn, err err
return
} else if len(resp) != 8 {
err = errors.New("Server does not respond properly.")
return
}
switch resp[1] {
case 90:
Expand Down

0 comments on commit 6e16ba9

Please sign in to comment.