Brian Warner [Tue, 14 Aug 2007 00:45:02 +0000 (17:45 -0700)]
webish: look for when_done= in POST fields as well as queryargs. Closes #101.
We need to look in the fields because that's how we build the mkdir/upload
forms. Without this, uploading or creating directories would leave us on a
page that had just a URI, instead of something actually useful to a human.
foolscap: change using-foolscap.xhtml to say "public key" instead of "private key"
In the first instance, I hope that the tubid is generated from the hash of the public key and not the hash of the private key!
In the latter instances, the phrase "public key" as in "public key certificate" is more common.
Brian Warner [Sat, 11 Aug 2007 00:25:33 +0000 (17:25 -0700)]
webish: reduce POST memory footprint by overriding http.Request
The original twisted.web.http.Request class has a requestReceived method
that parses the form body (in the request's .content filehandle) using
the stdlib cgi.parse_multipart() function. parse_multipart() consumes a
lot of memory when handling large file uploads, because it holds the
arguments entirely in RAM. Nevow's subclass of Request uses cgi.FieldStorage
instead, which is much more memory-efficient.
This patch uses a local subclass of Request and a modified copy of the
requestReceived method. It disables the cgi.parse_multipart parsing and
instead relies upon Nevow's use of FieldStorage. Our code must look for
form elements (which come from the body of the POST request) in req.fields,
rather than assuming that they will be copied into req.args (which now
only contains the query arguments that appear in the URL).
As a result, memory usage is no longer inflated by the size of the file
being uploaded in a POST upload request. Note that cgi.FieldStorage uses
temporary files (tempfile.TemporaryFile) to hold the data.
Brian Warner [Fri, 10 Aug 2007 01:26:17 +0000 (18:26 -0700)]
encode.py: add a reactor turn barrier between segments, to allow Deferreds to retire and free their arguments, all in the name of reducing memory footprint
However, I haven't heard back from Brian yet, so I'm actually going to put them back in the next patch so that I can compare the two versions of webapi.txt side by side.
webapi.txt: add "?t=file" flag and reorganize doc to discourage people from thinking that they know before hand the file-or-dir type of the thing that they are naming
Brian Warner [Thu, 9 Aug 2007 19:53:44 +0000 (12:53 -0700)]
introducer: don't log.err() an initial connection failure, since that flunks tests. Use self.log() instead. Also improve test_client.py to always trigger this case, before it was finishing to quickly to always hit the problem.
Brian Warner [Fri, 10 Aug 2007 01:26:57 +0000 (18:26 -0700)]
munin/tahoe-storagespace.py: use /bin/du instead of our python version, since
it a) is faster and b) will include filesystem overhead that is a real cost.
zfec: fix README.txt to explain how to use setuptools with GNU stow better
Also remove requirement of setuptools >= v0.6c3. I *think* that using setuptools in the modern way relieves this requirement, but I haven't tested it on dapper yet.
fix iputil so that it doesn't launch dozens of processes when you give it a full path and so that it tries executables in preference order and stops as soon as one gives out a dotted-quad string
misc/sizes.py: rename "block" to "share" and "subblock" to "block"
This renaming is already in place in all of our other documentation and code, but misc/sizes.py got overlooked.
require setuptools >= 0.6c6 on cygwin, and >= 0.6a9 on other platforms
Earlier I tried 0.6a9 (which comes in .deb format on Dapper) and something
didn't work, so I raised it to 0.6c3. However, I didn't make a note of what
failed, and so now I'm hoping that what failed was cygwin-specific. Anyway,
everyone look out for setuptools compatibility problems on the your favorite
platform (and I'll check the buildslaves), and we'll raise the required version
as little as possible and only on the problematic platform.