~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/http/_pycurl.py

Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
# TODO: test reporting of http errors
20
20
 
 
21
# TODO: Transport option to control caching of particular requests; broadly we
 
22
# would want to offer "caching allowed" or "must revalidate", depending on
 
23
# whether we expect a particular file will be modified after it's committed.
 
24
# It's probably safer to just always revalidate.  mbp 20060321
 
25
 
21
26
import os
22
27
from StringIO import StringIO
23
28
 
119
124
        # There's no way in http/1.0 to say "must revalidate"; we don't want
120
125
        # to force it to always retrieve.  so just turn off the default Pragma
121
126
        # provided by Curl.
122
 
        headers = ['Cache-control: must-revalidate',
123
 
                   'Pragma:']
 
127
        headers = ['Cache-control: max-age=0',
 
128
                   'Pragma: no-cache']
124
129
        ## curl.setopt(pycurl.VERBOSE, 1)
125
 
        # TODO: maybe show a summary of the pycurl version
126
 
        ua_str = 'bzr/%s (pycurl)' % (bzrlib.__version__) 
 
130
        # TODO: maybe include a summary of the pycurl version
 
131
        ua_str = 'bzr/%s (pycurl)' % (bzrlib.__version__)
127
132
        curl.setopt(pycurl.USERAGENT, ua_str)
128
133
        curl.setopt(pycurl.HTTPHEADER, headers)
129
134
        curl.setopt(pycurl.FOLLOWLOCATION, 1) # follow redirect responses