From: Ben Darnell Date: Sat, 19 Apr 2014 19:05:56 +0000 (-0400) Subject: Add a max_bytes to one remaining read_until in http1connection. X-Git-Tag: v4.0.0b1~91^2~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae7447abb6fa18b38b4657fae0f8561e005f5a5a;p=thirdparty%2Ftornado.git Add a max_bytes to one remaining read_until in http1connection. --- diff --git a/tornado/http1connection.py b/tornado/http1connection.py index e000ab889..b64425223 100644 --- a/tornado/http1connection.py +++ b/tornado/http1connection.py @@ -398,7 +398,7 @@ class HTTP1Connection(object): def _read_chunked_body(self): # TODO: "chunk extensions" http://tools.ietf.org/html/rfc2616#section-3.6.1 while True: - chunk_len = yield self.stream.read_until(b"\r\n") + chunk_len = yield self.stream.read_until(b"\r\n", max_bytes=64) chunk_len = int(chunk_len.strip(), 16) if chunk_len == 0: return