]> Cypherpunks repositories - gostls13.git/commitdiff
http: be clear when failing to connect to a proxy
authorBrad Fitzpatrick <bradfitz@golang.org>
Thu, 14 Apr 2011 20:49:19 +0000 (13:49 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 14 Apr 2011 20:49:19 +0000 (13:49 -0700)
Ubuntu and/or GNOME have some bug that likes
to set the "http_proxy" environment variable
and forgets to unset it.  This is annoying
to debug.  Be clear in the error message that
a proxy was in use.

R=rsc
CC=golang-dev
https://golang.org/cl/4409045

src/pkg/http/transport.go

index 7fa37af3b60d5160090641c7039d8ba2d6a4347d..d87a64613c5f146598eccbebd295da94186671b6 100644 (file)
@@ -217,6 +217,9 @@ func (t *Transport) getConn(cm *connectMethod) (*persistConn, os.Error) {
 
        conn, err := net.Dial("tcp", cm.addr())
        if err != nil {
+               if cm.proxyURL != nil {
+                       err = fmt.Errorf("http: error connecting to proxy %s: %v", cm.proxyURL, err)
+               }
                return nil, err
        }