From: Brian Warner Date: Thu, 22 May 2008 00:31:19 +0000 (-0700) Subject: scripts/common_http.py: add comment about why we need .seek X-Git-Tag: allmydata-tahoe-1.1.0~86 X-Git-Url: https://git.rkrishnan.org/pf/content/en/footer/class-simplejson.JSONDecoder.html?a=commitdiff_plain;h=282e22abcf3241613ec0b5877abc07f8a68575d2;p=tahoe-lafs%2Ftahoe-lafs.git scripts/common_http.py: add comment about why we need .seek --- diff --git a/src/allmydata/scripts/common_http.py b/src/allmydata/scripts/common_http.py index f2c060bd..c654927b 100644 --- a/src/allmydata/scripts/common_http.py +++ b/src/allmydata/scripts/common_http.py @@ -29,6 +29,9 @@ def do_http(method, url, body=""): elif isinstance(body, unicode): raise RuntimeError("do_http body must be a bytestring, not unicode") else: + # We must give a Content-Length header to twisted.web, otherwise it + # seems to get a zero-length file. I suspect that "chunked-encoding" + # may fix this. assert body.tell assert body.seek assert body.read