Skip to content

Commit

Permalink
Use net.JoinHostPort to joint host and port in benchmark.
Browse files Browse the repository at this point in the history
  • Loading branch information
cyfdecyf committed Jan 13, 2013
1 parent cef6bad commit 27df1d8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/shadowsocks-httpget/httpget.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@ func main() {
fmt.Println("Error parsing url:", err)
os.Exit(1)
}
host, port, _ := net.SplitHostPort(parsedURL.Host)
if port == "" {
host += ":80"
host, _, err := net.SplitHostPort(parsedURL.Host)
if err != nil {
host = net.JoinHostPort(parsedURL.Host, "80")
} else {
host = parsedURL.Host
}
fmt.Println(host)
// fmt.Println(host)
rawAddr, err := ss.RawAddr(host)
if err != nil {
panic("Error getting raw address.")
Expand Down

0 comments on commit 27df1d8

Please sign in to comment.