diff --git a/client.go b/client.go index 9a2ef85d5a..f0ce67f3c0 100644 --- a/client.go +++ b/client.go @@ -1617,8 +1617,7 @@ func (c *HostClient) dialConnFor(w *wantConn) { } cc := acquireClientConn(conn) - delivered := w.tryDeliver(cc, nil) - if !delivered { + if !w.tryDeliver(cc, nil) { // not delivered, return idle connection c.releaseConn(cc) } diff --git a/fasthttpproxy/http.go b/fasthttpproxy/http.go index 9dd5a255be..94d2b09c7e 100644 --- a/fasthttpproxy/http.go +++ b/fasthttpproxy/http.go @@ -51,7 +51,7 @@ func FasthttpHTTPDialerTimeout(proxy string, timeout time.Duration) fasthttp.Dia return nil, err } - req := fmt.Sprintf("CONNECT %s HTTP/1.1\r\nHost: %s\r\n", addr, addr) + req := "CONNECT " + addr + " HTTP/1.1\r\nHost: " + addr + "\r\n" if auth != "" { req += "Proxy-Authorization: Basic " + auth + "\r\n" }