[Pkg-bazaar-maint] Bug#588430: Delayed NMU with upstream fix

Maximiliano Curia maxy at debian.org
Sat Jul 31 15:39:11 UTC 2010


Hi,

Upstream already fixed this, the patch is quite clean so I'm uploading a 5
days delayed nmu with the following patch:

Index: bzr-2.1.2/bzrlib/transport/http/_urllib2_wrappers.py
===================================================================
--- bzr-2.1.2.orig/bzrlib/transport/http/_urllib2_wrappers.py	2010-07-30 19:08:56.000000000 -0400
+++ bzr-2.1.2/bzrlib/transport/http/_urllib2_wrappers.py	2010-07-30 19:09:11.000000000 -0400
@@ -378,6 +378,11 @@
             port = conn_class.default_port
         self.proxied_host = '%s:%s' % (host, port)
         urllib2.Request.set_proxy(self, proxy, type)
+        # When urllib2 makes a https request with our wrapper code and a proxy,
+        # it sets Host to the https proxy, not the host we want to talk to.
+        # I'm fairly sure this is our fault, but what is the cause is an open
+        # question. -- Robert Collins May 8 2010.
+        self.add_unredirected_header('Host', self.proxied_host)
 
 
 class _ConnectRequest(Request):
@@ -711,7 +716,7 @@
             connect = _ConnectRequest(request)
             response = self.parent.open(connect)
             if response.code != 200:
-                raise ConnectionError("Can't connect to %s via proxy %s" % (
+                raise errors.ConnectionError("Can't connect to %s via proxy %s" % (
                         connect.proxied_host, self.host))
             # Housekeeping
             connection.cleanup_pipe()
@@ -868,21 +873,19 @@
                 print 'Will unbind %s_open for %r' % (type, proxy)
             delattr(self, '%s_open' % type)
 
+        def bind_scheme_request(proxy, scheme):
+            if proxy is None:
+                return
+            scheme_request = scheme + '_request'
+            if self._debuglevel >= 3:
+                print 'Will bind %s for %r' % (scheme_request, proxy)
+            setattr(self, scheme_request,
+                lambda request: self.set_proxy(request, scheme))
         # We are interested only by the http[s] proxies
         http_proxy = self.get_proxy_env_var('http')
+        bind_scheme_request(http_proxy, 'http')
         https_proxy = self.get_proxy_env_var('https')
-
-        if http_proxy is not None:
-            if self._debuglevel >= 3:
-                print 'Will bind http_request for %r' % http_proxy
-            setattr(self, 'http_request',
-                    lambda request: self.set_proxy(request, 'http'))
-
-        if https_proxy is not None:
-            if self._debuglevel >= 3:
-                print 'Will bind http_request for %r' % https_proxy
-            setattr(self, 'https_request',
-                    lambda request: self.set_proxy(request, 'https'))
+        bind_scheme_request(https_proxy, 'https')
 
     def get_proxy_env_var(self, name, default_to='all'):
         """Get a proxy env var.

Thanks,
-- 
"recursividad 95, 154, 156, 201, 224, 293" 
	-- El Lenguaje de Programacion C, pag. 293 (Kernighan & Ritchie)
Saludos /\/\ /\ >< `/





More information about the Pkg-bazaar-maint mailing list