]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Add a max_bytes to one remaining read_until in http1connection.
authorBen Darnell <ben@bendarnell.com>
Sat, 19 Apr 2014 19:05:56 +0000 (15:05 -0400)
committerBen Darnell <ben@bendarnell.com>
Sat, 19 Apr 2014 19:05:56 +0000 (15:05 -0400)
tornado/http1connection.py

index e000ab8894e719cbe4c203416f444ad99d959871..b64425223e86db2252264c3e0fb92e9175732741 100644 (file)
@@ -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