Ticket #1193: patch

File patch, 862 bytes (added by guyzmo, at 2010-09-03T16:40:37Z)

the actual patch

Line 
1Fri Sep  3 18:03:52 CEST 2010  Bernard `Guyzmo` Pratz <bpratz{at}bearstech.com>
2  * Added range support to do_http() and inside get()
3diff -rN old-tahoe-lafs/src/allmydata/scripts/common_http.py new-tahoe-lafs/src/allmydata/scripts/common_http.py
430c30
5< def do_http(method, url, body=""):
6---
7> def do_http(method, url, body="", headers={}):
853a54,55
9>     for header, value in headers.iteritems():
10>         c.putheader(header, value)
11diff -rN old-tahoe-lafs/src/allmydata/scripts/tahoe_get.py new-tahoe-lafs/src/allmydata/scripts/tahoe_get.py
1213a14
13>     frange = None
1426,27c27,31
15<     resp = do_http("GET", url)
16<     if resp.status in (200, 201,):
17---
18>     if frange:
19>         resp = do_http("GET", url, headers={'Range' : 'bytes=%d-%d' % (frange[0], frange[1])})
20>     else:
21>         resp = do_http("GET", url)
22>     if resp.status in (200, 201, 206):