Describe feature request for cgi.py's FieldStorage class to improve
memory consumption in the face of large binary uploads. Closes bug #110674.
This commit is contained in:
parent
bfa8e79f58
commit
e085f82ba9
17
pep-0042.txt
17
pep-0042.txt
|
@ -139,6 +139,23 @@ Standard Library
|
||||||
|
|
||||||
https://sourceforge.net/bugs/?func=detailbug&bug_id=110678&group_id=5470
|
https://sourceforge.net/bugs/?func=detailbug&bug_id=110678&group_id=5470
|
||||||
|
|
||||||
|
- cgi.py's FieldStorage class should be more conservative with
|
||||||
|
memory in the face of large binary file uploads.
|
||||||
|
|
||||||
|
https://sourceforge.net/bugs/?func=detailbug&bug_id=110674&group_id=5470
|
||||||
|
|
||||||
|
There are two issues here: first, because
|
||||||
|
read_lines_to_outerboundary() uses readline() it is possible
|
||||||
|
that a large amount of data will be read into memory for a
|
||||||
|
binary file upload. This should probably look at the
|
||||||
|
Content-Type header of the section and do a chunked read if it's
|
||||||
|
a binary type.
|
||||||
|
|
||||||
|
Second, because the lines that are read are stored in an
|
||||||
|
instance attribute (self.lines -- a list), the uploaded data is
|
||||||
|
never freed. self.lines isn't definied as part of the public
|
||||||
|
interface it /might/ be safe to remove it. OTOH, removing it
|
||||||
|
will break code clever and nosy code.
|
||||||
|
|
||||||
Tools
|
Tools
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue