Show More
@@ -7,7 +7,7 b'' | |||
|
7 | 7 | # This software may be used and distributed according to the terms of the |
|
8 | 8 | # GNU General Public License version 2 or any later version. |
|
9 | 9 | |
|
10 |
import urllib, urllib2 |
|
|
10 | import urllib, urllib2, httplib, os, socket, cStringIO | |
|
11 | 11 | import __builtin__ |
|
12 | 12 | from i18n import _ |
|
13 | 13 | import keepalive, util |
@@ -407,14 +407,10 b' class proxyhandler(urllib2.ProxyHandler)' | |||
|
407 | 407 | if not (proxyurl.startswith('http:') or |
|
408 | 408 | proxyurl.startswith('https:')): |
|
409 | 409 | proxyurl = 'http://' + proxyurl + '/' |
|
410 |
|
|
|
411 | proxyscheme, proxynetloc, proxypath, proxyquery, proxyfrag = snpqf | |
|
412 | hpup = netlocsplit(proxynetloc) | |
|
413 | ||
|
414 | proxyhost, proxyport, proxyuser, proxypasswd = hpup | |
|
415 | if not proxyuser: | |
|
416 | proxyuser = ui.config("http_proxy", "user") | |
|
417 | proxypasswd = ui.config("http_proxy", "passwd") | |
|
410 | proxy = url(proxyurl) | |
|
411 | if not proxy.user: | |
|
412 | proxy.user = ui.config("http_proxy", "user") | |
|
413 | proxy.passwd = ui.config("http_proxy", "passwd") | |
|
418 | 414 | |
|
419 | 415 | # see if we should use a proxy for this url |
|
420 | 416 | no_list = ["localhost", "127.0.0.1"] |
@@ -429,13 +425,10 b' class proxyhandler(urllib2.ProxyHandler)' | |||
|
429 | 425 | else: |
|
430 | 426 | self.no_list = no_list |
|
431 | 427 | |
|
432 |
proxyurl = |
|
|
433 | proxyscheme, netlocunsplit(proxyhost, proxyport, | |
|
434 | proxyuser, proxypasswd or ''), | |
|
435 | proxypath, proxyquery, proxyfrag)) | |
|
428 | proxyurl = str(proxy) | |
|
436 | 429 | proxies = {'http': proxyurl, 'https': proxyurl} |
|
437 | 430 | ui.debug('proxying through http://%s:%s\n' % |
|
438 | (proxyhost, proxyport)) | |
|
431 | (proxy.host, proxy.port)) | |
|
439 | 432 | else: |
|
440 | 433 | proxies = {} |
|
441 | 434 | |
@@ -602,13 +595,9 b' def _generic_start_transaction(handler, ' | |||
|
602 | 595 | new_tunnel = False |
|
603 | 596 | |
|
604 | 597 | if new_tunnel or tunnel_host == req.get_full_url(): # has proxy |
|
605 |
u |
|
|
606 |
if new_tunnel or u |
|
|
607 |
realhostport = |
|
|
608 | if realhostport[-1] == ']' or ':' not in realhostport: | |
|
609 | realhostport += ':443' | |
|
610 | ||
|
611 | h.realhostport = realhostport | |
|
598 | u = url(tunnel_host) | |
|
599 | if new_tunnel or u.scheme == 'https': # only use CONNECT for HTTPS | |
|
600 | h.realhostport = ':'.join([u.host, (u.port or '443')]) | |
|
612 | 601 | h.headers = req.headers.copy() |
|
613 | 602 | h.headers.update(handler.parent.addheaders) |
|
614 | 603 | return |
General Comments 0
You need to be logged in to leave comments.
Login now