[tahoe-dev] [tahoe-lafs] #677: WebAPI: GET /uri/$FILECAP?t=json doesn't return size for mutable files, but the HTML version does
tahoe-lafs
trac at allmydata.org
Wed Jun 17 01:58:14 PDT 2009
#677: WebAPI: GET /uri/$FILECAP?t=json doesn't return size for mutable files, but
the HTML version does
-------------------------------+--------------------------------------------
Reporter: soult | Owner:
Type: defect | Status: new
Priority: trivial | Milestone: undecided
Component: code-frontend-web | Version: 1.3.0
Keywords: | Launchpad_bug:
-------------------------------+--------------------------------------------
Comment(by warner):
yeah, get_size_of_best_version() is fairly new, and the JSON-rendering
code was written before it was available. Also, I seem to remember that
requiring a Deferred to get that size was annoying, and I didn't want to
slow down a directory listing by doing a mapupdate for every single
mutable file therein.
For CHK files, the size is stored in the filecap, so it's trivial to get
it. For mutable files, you have to ask around and find out what versions
are available. This "mapupdate" operation isn't as expensive as actually
retrieving the file's contents, but it's close (a roundtrip or two).
Your approach sounds reasonable. Be sure to think about whether it's
t=JSON on a single file that gets this fix, and/or t=JSON on a whole
directory (which might not be a good idea, if there are lots of mutable
files in it). It'd probably be better to leave the "size" field out of the
elements of a directory fetch than to include "?" strings.
--
Ticket URL: <http://allmydata.org/trac/tahoe/ticket/677#comment:2>
tahoe-lafs <http://allmydata.org>
secure decentralized file storage grid
More information about the tahoe-dev
mailing list