Ticket #8073 (new Bug)
get_size reports incorrect length for FTP and WEBDAV PROPFIND, breaks davfs2
| Reported by: | wolfmanx | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 3.3.x |
| Component: | Archetypes | Keywords: | webdav, blackbelt |
| Cc: | grahamperrin |
Description
Some objects (e.g. ATDocument) calculate their size in get_size() (inherited from ATCTMixin) based on the primary field only.
However, when the data is actually retrieved a set of header lines is prepended in manage_FTPget() (inherited from BaseContentMixin), which adds to the reported size.
This discrepancy breaks davfs2 under Linux. On the first retrieval, davfs2 delivers only the amount of data as reported in the PROPFIND response. If the second retrieval falls within the cache period, the actual amount of data is delivered.
I am wondering why get_size() is separated from manage_FTPget() as they really seem to be related (at least according to the Zope base classes which use get_size() for reporting the property n:getcontentlength and manage_FTPget() to deliver the contents).
I have patched get_size() in ATCTMixin to use len(self.manage_FTPget()) for a test. The file size was then shown properly and all content was retrieved from ATDocument. However, the patch breaks e.g. PloneExFile on the HTTP side of Plone.
Also, always reporting a size of 1 for all syndication_information files does not really cut it :)).
If you do not want to fix it, I would still be a great help, if you could point my to the right base class where I can fix it myself. (The multiple inheritance of ATDocument is pretty overwhelming for a beginner :)).

Sidnei, do you have an idea where to fix this best?