summaryrefslogtreecommitdiff
path: root/python2
diff options
context:
space:
mode:
authorJoe Gregorio <jcgregorio@google.com>2012-01-06 13:55:36 -0500
committerJoe Gregorio <jcgregorio@google.com>2012-01-06 13:55:36 -0500
commit16f48c454ebe035c65274fc6bbf902f41f1ccec3 (patch)
treea3932d41b3b8689370e1f52c2179f462185395c8 /python2
parent12c98bbc935a16a1f2cdbc42555d466dcc434c19 (diff)
downloadhttplib2-16f48c454ebe035c65274fc6bbf902f41f1ccec3.tar.gz
When opening a socket for HTTP, httplib2 uses the IP and port that is returned from socket.getaddrinfo(self.host, self.port, 0, socket.SOCK_STREAM). This breaks using an HTTP CONNECT proxy by preventing the socks module from ever seeing the original domain name. Using the orignal hostname and port seem to be the correct choice here as the socket library will resolve them and it would have already been cached.
Diffstat (limited to 'python2')
-rw-r--r--python2/httplib2/__init__.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/python2/httplib2/__init__.py b/python2/httplib2/__init__.py
index d1dc89d..e2d8517 100644
--- a/python2/httplib2/__init__.py
+++ b/python2/httplib2/__init__.py
@@ -874,7 +874,7 @@ class HTTPConnectionWithTimeout(httplib.HTTPConnection):
if self.debuglevel > 0:
print "connect: (%s, %s)" % (self.host, self.port)
- self.sock.connect(sa)
+ self.sock.connect((self.host, self.port) + sa[2:])
except socket.error, msg:
if self.debuglevel > 0:
print 'connect fail:', (self.host, self.port)