[Pkg-bazaar-commits] ./bzr/unstable r193: more experiments with http get

mbp at sourcefrog.net mbp at sourcefrog.net
Fri Apr 10 07:44:03 UTC 2009


------------------------------------------------------------
revno: 193
committer: mbp at sourcefrog.net
timestamp: Fri 2005-04-08 15:38:42 +1000
message:
  more experiments with http get
modified:
  bzrlib/remotebranch.py
-------------- next part --------------
=== modified file 'bzrlib/remotebranch.py'
--- a/bzrlib/remotebranch.py	2005-04-07 07:08:53 +0000
+++ b/bzrlib/remotebranch.py	2005-04-08 05:38:42 +0000
@@ -32,16 +32,24 @@
 # h = HTTPConnection('localhost:8000')
 # h = HTTPConnection('bazaar-ng.org')
 
-
-# prefix = 'http://localhost:8000'
-prefix = 'http://bazaar-ng.org/bzr/main/'
+# velocitynet.com.au transparently proxies connections and thereby
+# breaks keep-alive -- sucks!
+
+
+import urlgrabber.keepalive
+urlgrabber.keepalive.DEBUG = 2
+
+import urlgrabber
+
+prefix = 'http://localhost:8000'
+# prefix = 'http://bazaar-ng.org/bzr/main/'
 
 def get_url(path, compressed=False):
     try:
         url = prefix + path
         if compressed:
             url += '.gz'
-        url_f = urllib2.urlopen(url)
+        url_f = urlgrabber.urlopen(url, keepalive=1, close_connection=0)
         if not compressed:
             return url_f
         else:



More information about the Pkg-bazaar-commits mailing list