~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Aaron Bentley
  • Date: 2008-02-24 16:42:13 UTC
  • mfrom: (3234 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3235.
  • Revision ID: aaron@aaronbentley.com-20080224164213-eza1lzru5bwuwmmj
Merge with bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
217
217
        offsets = list(offsets)
218
218
 
219
219
        try_again = True
 
220
        retried_offset = None
220
221
        while try_again:
221
222
            try_again = False
222
223
 
271
272
 
272
273
            except (errors.ShortReadvError, errors.InvalidRange,
273
274
                    errors.InvalidHttpRange), e:
274
 
                self._degrade_range_hint(relpath, coalesced, sys.exc_info())
 
275
                mutter('Exception %r: %s during http._readv',e, e)
 
276
                if (not isinstance(e, errors.ShortReadvError)
 
277
                    or retried_offset == cur_offset_and_size):
 
278
                    # We don't degrade the range hint for ShortReadvError since
 
279
                    # they do not indicate a problem with the server ability to
 
280
                    # handle ranges. Except when we fail to get back a required
 
281
                    # offset twice in a row. In that case, falling back to
 
282
                    # single range or whole file should help or end up in a
 
283
                    # fatal exception.
 
284
                    self._degrade_range_hint(relpath, coalesced, sys.exc_info())
275
285
                # Some offsets may have been already processed, so we retry
276
286
                # only the unsuccessful ones.
277
287
                offsets = [cur_offset_and_size] + [o for o in iter_offsets]
 
288
                retried_offset = cur_offset_and_size
278
289
                try_again = True
279
290
 
280
291
    def _coalesce_readv(self, relpath, coalesced):