~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-07-03 07:35:46 UTC
  • mfrom: (2574.1.1 ianc-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20070703073546-9dv8bocak8u3ou6m
(Vincent Ladeuil) Fix #115209 - Unable to handle http code 400: Bad Request When issuing too many ranges

Show diffs side-by-side

added added

removed removed

Lines of Context:
136
136
        else:
137
137
            self._raise_curl_http_error(curl)
138
138
 
139
 
    def _get(self, relpath, ranges, tail_amount=0):
 
139
    def _get(self, relpath, offsets, tail_amount=0):
140
140
        # This just switches based on the type of request
141
 
        if ranges is not None or tail_amount not in (0, None):
142
 
            return self._get_ranged(relpath, ranges, tail_amount=tail_amount)
 
141
        if offsets is not None or tail_amount not in (0, None):
 
142
            return self._get_ranged(relpath, offsets, tail_amount=tail_amount)
143
143
        else:
144
144
            return self._get_full(relpath)
145
145
 
189
189
 
190
190
        return code, data
191
191
 
192
 
    def _get_ranged(self, relpath, ranges, tail_amount):
 
192
    def _get_ranged(self, relpath, offsets, tail_amount):
193
193
        """Make a request for just part of the file."""
194
194
        curl = self._curl
195
195
        abspath, data, header = self._setup_get_request(curl, relpath)
196
196
 
197
 
        range_header = self.attempted_range_header(ranges, tail_amount)
 
197
        range_header = self._attempted_range_header(offsets, tail_amount)
198
198
        if range_header is None:
199
199
            # Forget ranges, the server can't handle them
200
200
            return self._get_full(relpath)