[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
Tue Jun 16 19:30:44 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 swillden):
This one is causing me some trouble, so I did some investigation.
The immediate culprit is them implementation of
MutableFileNode.get_size(), in mutable/filenode.py, line 195. The
implementation is supremely simple, and not very useful:
{{{return "?"}}}
I'm assuming this is because finding out the size of a mutable node isn't
easy. The implementation of the HTML "More Info" page, makes a deferred
call to get_size_of_best_version(), so I presume that's what's needed for
the JSON as well.
I've attached a patch that seems to fix the problem, by doing a deferred
call to get_size_of_best_version(), but I'm not very familiar with this
code so I don't know it's the best way to handle the issue. I'll create a
test case, too.
--
Ticket URL: <http://allmydata.org/trac/tahoe/ticket/677#comment:1>
tahoe-lafs <http://allmydata.org>
secure decentralized file storage grid
More information about the tahoe-dev
mailing list