~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/remotebranch.py

  • Committer: mbp at sourcefrog
  • Date: 2005-04-08 05:38:42 UTC
  • Revision ID: mbp@sourcefrog.net-20050408053842-9bd97f96de87d9185583b310
more experiments with http get

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
# h = HTTPConnection('localhost:8000')
33
33
# h = HTTPConnection('bazaar-ng.org')
34
34
 
35
 
 
36
 
# prefix = 'http://localhost:8000'
37
 
prefix = 'http://bazaar-ng.org/bzr/main/'
 
35
# velocitynet.com.au transparently proxies connections and thereby
 
36
# breaks keep-alive -- sucks!
 
37
 
 
38
 
 
39
import urlgrabber.keepalive
 
40
urlgrabber.keepalive.DEBUG = 2
 
41
 
 
42
import urlgrabber
 
43
 
 
44
prefix = 'http://localhost:8000'
 
45
# prefix = 'http://bazaar-ng.org/bzr/main/'
38
46
 
39
47
def get_url(path, compressed=False):
40
48
    try:
41
49
        url = prefix + path
42
50
        if compressed:
43
51
            url += '.gz'
44
 
        url_f = urllib2.urlopen(url)
 
52
        url_f = urlgrabber.urlopen(url, keepalive=1, close_connection=0)
45
53
        if not compressed:
46
54
            return url_f
47
55
        else: