116
def _get(self, relpath, ranges, tail_amount=0):
116
def _get(self, relpath, offsets, tail_amount=0):
117
117
"""See HttpTransport._get"""
119
119
abspath = self._real_abspath(relpath)
121
if ranges or tail_amount:
122
range_header = self.attempted_range_header(ranges, tail_amount)
121
accepted_errors = [200, 404]
122
if offsets or tail_amount:
123
range_header = self._attempted_range_header(offsets, tail_amount)
123
124
if range_header is not None:
125
accepted_errors.append(206)
126
accepted_errors.append(400)
124
127
bytes = 'bytes=' + range_header
125
128
headers = {'Range': bytes}
127
request = Request('GET', abspath, None, headers)
130
request = Request('GET', abspath, None, headers,
131
accepted_errors=accepted_errors)
128
132
response = self._perform(request)
130
134
code = response.code
157
161
Performs the request and leaves callers handle the results.
159
163
abspath = self._real_abspath(relpath)
160
request = Request('HEAD', abspath)
164
request = Request('HEAD', abspath,
165
accepted_errors=[200, 404])
161
166
response = self._perform(request)
163
168
self._connection.fake_close()