Changes between Version 13 and Version 14 of Extensions


Ignore:
Timestamp:
2010-04-04T15:41:02Z (14 years ago)
Author:
davidsarah
Comment:

URI formats for immutable dirs; recommended HTTP debugging tools; web browsers don't support PUT/DELETE

Legend:

Unmodified
Added
Removed
Modified
  • Extensions

    v13 v14  
    1616Tahoe URIs may refer to either immutable or mutable content.  URIs for immutable data are simple to cache by mapping the URI to the contents.
    1717
    18 Mutability is independent of read-only capabilities.  A read-only capability may refer to mutable content (i.e. *you* can't write to it, but somebody else might be able to).
     18A read-only capability is not necessarily immutable.  It may refer to mutable content (i.e. *you* can't write to it, but somebody else might be able to).
    1919
    2020To determine the mutability of a URI, parse the second field of the URI (delimited by ':'):
    2121
    22  * URI:CHK:...    : immutable
    23  * URI:LIT:...    : immutable
    24  * URI:SSK:...    : mutable, writable
    25  * URI:SSK-RO:... : mutable, not writable
    26  * URI:DIR:...    : mutable, writable
    27  * URI:DIR-RO:... : mutable, not writable
     22 * URI:CHK:...     : immutable
     23 * URI:LIT:...     : immutable
     24 * URI:SSK:...     : mutable, writable
     25 * URI:SSK-RO:...  : mutable, not writable
     26 * URI:DIR-CHK:... : immutable
     27 * URI:DIR-LIT:... : immutable
     28 * URI:DIR:...     : mutable, writable
     29 * URI:DIR-RO:...  : mutable, not writable
    2830
    29 Note: Currently most files are immutable, and all directories are mutable, but in the future the node type (file or directory) and the mutability will be independent.  It's a bad idea to rely on the node type to determine mutability.
     31Note: Currently most files are immutable, and directories are mutable by default (except those created by {{{tahoe backup}}}), but mutable files and immutable directries are possible.  It's a bad idea to rely on the node type to determine mutability.
    3032
     33In Python code that is part of or linked with Tahoe, you should probably avoid parsing the URI yourself. Instead create an {{{IURI}}} object using {{{uri.from_string}}}, then call {{{is_mutable()}}} or {{{is_readonly()}}} on the result (note that these will throw an exception if the node {{{is_unknown()}}}).
    3134
    3235=== HTTP methods ===
     
    3942   * Python 2.5's stdlib modules ({{{httplib}}}, {{{urllib}}}) provide good support for arbitrary methods.
    4043 * The following clients do not seem to support either {{{PUT}}} and {{{DELETE}}}:
    41    * ...
    42  * We have not yet determined if the following have support for arbitrary methods:
    43    * Common web browsers. In general, HTML forms can only cause GET and POST operations. Javascript might have more abilities.
     44   * Common web browsers. In general, HTML forms can only cause GET and POST operations. {{{XMLHttpRequest}}} is similarly restricted, I think.
     45
     46A good command-line HTTP client (written in Python) that supports making arbitrary HTTP requests is [http://code.google.com/p/restez/ restez]. For Windows only, a useful debugging proxy for capturing HTTP requests made by browsers and other clients is [http://www.fiddler2.com Fiddler2].
    4447
    4548=== Race Conditions ===
    4649
    47 Race conditions commonly exist in programs which use traditional directory structure interfaces.  The webapi.txt document describes how to avoid many of these situations by relying on file URI's, instead of their vdrive names.
     50Race conditions commonly exist in programs which use traditional directory structure interfaces.  The webapi.txt document describes how to avoid many of these situations by relying on file URIs in preference to paths.
    4851
    4952= See Also =