Commit Graph

518 Commits

Author SHA1 Message Date
Brian Warner
ceef80bee6 scripts: rearrange Options, make --version behave the same for all commands 2007-08-16 12:50:19 -07:00
Zooko O'Whielacronx
4ed7f0ac2a fix small bug in unit tests which caused spurious failures on Windows 2007-08-16 14:14:41 -07:00
Zooko O'Whielacronx
a431811011 in-line doc edit: s/pyutil/allmydata.util/ 2007-08-16 14:10:48 -07:00
Zooko O'Whielacronx
094b687d6e import version class and make-version script from pyutil -- fixes win32 build, improves error handling, and eliminates unused features 2007-08-16 14:09:30 -07:00
Zooko O'Whielacronx
6c4fb6fd93 a first crack at the "put" command-line
There are actually two versions in this patch, one of which requires twisted.web2 and the other of which uses the Python standard library's socket module.  The socketish one doesn't know when the web server is done so it hangs after doing its thing.  (Oh -- maybe I should add an HTTP header asking the web server to close the connection when finished.)  The web2ish one works better in that respect.  Neither of them handle error responses from the server very well yet.

After lunch I intend to finish the socketish one.

To try one, mv src/allmydata/scripts/tahoe_put-{socketish,web2ish}.py src/allmydata/scripts/tahoe_put.py .

If you want to try the web2ish one, and you can't find a web2 package to install, you can get one from:

http://allmydata.org/~zooko/repos/twistedweb2snarf/
2007-08-16 12:15:38 -07:00
Brian Warner
ee6a6c79fa webish.py: allow users to delete (but not create) empty-named files. Closes #94. 2007-08-15 23:14:05 -07:00
Brian Warner
c1da0c11bc webish: implement replace= for POST commands 2007-08-15 15:21:38 -07:00
Brian Warner
1752c9e29e webish: implement replace= for PUT commands 2007-08-15 13:22:23 -07:00
Brian Warner
42dcc3088e IDirectoryNode: add has_child() method 2007-08-15 13:22:01 -07:00
Brian Warner
244471dcc4 check_memory.py: Disable the 100MB test for now: our buildslave can't currently handle it because the testnet/framework processes uses something like 600M of RSS. 2007-08-15 12:55:11 -07:00
Brian Warner
a0c16f1a36 client.py: make a note in the logs when the auto-shutdown feature is in use 2007-08-14 02:12:30 -07:00
Brian Warner
179d5462c0 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.
2007-08-13 17:45:02 -07:00
Brian Warner
6c6c62037d fix pyflakes warnings from recent b32decode change 2007-08-12 16:33:51 -07:00
Brian Warner
0332e94656 test_system.py: add coverage for get_permuted_peers() 2007-08-12 16:29:34 -07:00
Brian Warner
1ac83637a6 Client.get_permuted_peers: use self.nodeid now that it's fixed 2007-08-12 16:24:51 -07:00
tahoe
53349c571f shorten ids 2007-08-12 11:53:18 -07:00
Zooko O'Whielacronx
42f8e57416 don't over-encode the nodeid many times with ascii-encoding 2007-08-12 10:29:38 -07:00
Brian Warner
2f5a27316f webish: localfile=/localdir= are now disabled by default, a special switch is required to enable them 2007-08-10 18:21:22 -07:00
Brian Warner
9281a0aedc 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.

This closes #29.
2007-08-10 17:25:33 -07:00
Brian Warner
b6ff38e4c7 webish.POSTHandler: fix typo that meant we didn't look for 'name' in req.fields 2007-08-10 17:25:28 -07:00
Brian Warner
998802fd6d #96: add flag to enable pushing data to ourselves, defaulting to False 2007-08-09 18:30:24 -07:00
Brian Warner
8b14ad1673 encode.py: log a percentage complete as well as the raw byte counts 2007-08-09 18:28:45 -07:00
Brian Warner
08ee80176a Encoder.__repr__: mention the file being encoded 2007-08-09 18:26:56 -07:00
Brian Warner
684966d103 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 2007-08-09 18:26:17 -07:00
Zooko O'Whielacronx
531109e803 fix test_web refactoring so that the WebMixin class isn't a TestCase
Thanks, Brian.
2007-08-10 08:40:02 -07:00
wilcoxjg
e13783cd6a If do_stop attempts to stop a nonexistent process the OSError exception is caught (by errno) and handled tersely. 2007-08-09 08:57:45 -07:00
Zooko O'Whielacronx
39f218ab90 refactor test_web so that other tests can use the part of test_web that sets up a simple filesystem 2007-08-09 13:08:42 -07:00
Brian Warner
9ac5c14037 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. 2007-08-09 12:53:44 -07:00
Brian Warner
84d41adfcc check_memory.py: include a single 100MB test 2007-08-09 11:30:33 -07:00
Zooko O'Whielacronx
9b08691f51 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 2007-08-09 10:56:47 -07:00
Zooko O'Whielacronx
524c9f1fc2 startstop_node now works if the logs directory already exists
Thanks to Arno and Arch for pointing this out.
2007-08-08 21:43:48 -07:00
Brian Warner
57df32aac5 now that the buildslave is moved to a new machine, enable the 50MB test 2007-08-09 01:32:52 -07:00
Zooko O'Whielacronx
42d3afffa2 refactor test_uri and add a test of the empty file 2007-07-26 10:48:30 -07:00
Brian Warner
2ba415bd3e move nodelogs from BASEDIR/twistd.log* to BASEDIR/logs/twistd.log*, closes #61 2007-07-24 20:44:33 -07:00
Brian Warner
8de93635af test_web.py: oops, fix syntax error caused by removing comments 2007-07-25 03:21:30 -07:00
Brian Warner
6aff425fd2 test_web.py: remove spurious '# YES' lines, now that all the tests pass 2007-07-24 20:16:21 -07:00
Brian Warner
f664d4d80d vdrive: eventually create public/private dirnodes event if the vdrive server isn't available at start up 2007-07-24 19:44:25 -07:00
Brian Warner
c3293f4f37 interfaces: move signatures into docstrings, to reduce lines of code and improve code-coverage numbers 2007-07-24 19:43:21 -07:00
Brian Warner
e3eba2d6c5 remove unused imports: hush pyflakes warnings 2007-07-24 18:13:58 -07:00
Zooko O'Whielacronx
32c90c6468 switch from rfc 3548 base-32 to z-base-32 except for tubids/nodeids 2007-07-24 13:46:06 -07:00
Brian Warner
e6e9ddc588 refactor upload/encode, to split encrypt and encode responsibilities 2007-07-23 19:31:53 -07:00
Brian Warner
9c5ab89afe truncate storage index to 128 bits, since it's derived from a 128 bit AES key 2007-07-22 19:48:44 -07:00
Brian Warner
81a9904455 CHK: remove the storage index from the URI, deriving it from the key instead 2007-07-21 18:23:15 -07:00
Brian Warner
2bc3c163b6 uri.py: get keys and index from the URI instance 2007-07-21 17:45:00 -07:00
Brian Warner
1d9a58977f uri: implement URI-processing classes, IFileURI/IDirnodeURI, use internally 2007-07-21 15:40:36 -07:00
Brian Warner
32fcf0b405 dirnode.build_manifest(): tolerate cycles in the directory graph 2007-07-21 15:40:13 -07:00
Brian Warner
e3a57fca98 upload: finish refactoring, all unit tests pass now 2007-07-19 22:53:29 -07:00
Brian Warner
9af506900b upload: refactor to enable streaming upload. not all tests pass yet 2007-07-19 18:21:44 -07:00
Brian Warner
a7f04616bf webish: improve test coverage further 2007-07-17 12:28:29 -07:00
Brian Warner
3197e1d39b webish: improve test coverage of WebDownloadTarget 2007-07-17 12:16:45 -07:00