~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Patch Queue Manager
  • Date: 2012-01-28 02:39:16 UTC
  • mfrom: (6352.4.6 get-seeks-backwards)
  • Revision ID: pqm@pqm.ubuntu.com-20120128023916-3eosqh9rfscupjb0
(jelmer) Avoid caching complete files in memory when accessing over HTTP.
 (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
from __future__ import absolute_import
23
23
 
24
 
from cStringIO import StringIO
25
24
import re
26
25
import urlparse
27
26
import sys
119
118
        :param relpath: The relative path to the file
120
119
        """
121
120
        code, response_file = self._get(relpath, None)
122
 
        # FIXME: some callers want an iterable... One step forward, three steps
123
 
        # backwards :-/ And not only an iterable, but an iterable that can be
124
 
        # seeked backwards, so we will never be able to do that.  One such
125
 
        # known client is bzrlib.bundle.serializer.v4.get_bundle_reader. At the
126
 
        # time of this writing it's even the only known client -- vila20071203
127
 
        return StringIO(response_file.read())
 
121
        return response_file
128
122
 
129
123
    def _get(self, relpath, ranges, tail_amount=0):
130
124
        """Get a file, or part of a file.