[tahoe-dev] a question about req.content
Zooko Wilcox-O'Hearn
zooko at zooko.com
Mon Nov 19 17:48:30 UTC 2012
Hello han zheng:
> When I saw the logging information, I saw a string "fdopen" when I "print" the req.content. So what is the meaning of the "fdopen" ?
"fdopen" is a Python library type:
http://docs.python.org/3/library/os.html?highlight=fdopen#os.fdopen
I believe the LAFS gateway is storing the uploaded data, if it is
large enough, in a temporary file on disk instead of in RAM. Here is
the code in the Twisted HTTP server that does that:
http://twistedmatrix.com/trac/browser/trunk/twisted/web/http.py?annotate=blame&rev=36410#L667
It looks like (with current HEAD of Twisted) it does this if the
request body is >= 100,000 bytes.
The Python standard library "tempfile" module that Twisted uses
produces things whose description includes "fdopen":
http://docs.python.org/3/library/tempfile.html
Regards,
Zooko
More information about the tahoe-dev
mailing list