Ticket #8073 (new Bug)

Opened 4 years ago

Last modified 3 months ago

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 :)).

Change History

comment:1 Changed 4 years ago by nouri

  • Owner changed from nouri to sidnei

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

comment:2 Changed 4 years ago by hannosch

  • Owner changed from sidnei to dreamcatcher

comment:3 Changed 4 years ago by hannosch

  • Owner dreamcatcher deleted

comment:4 Changed 3 years ago by gabdavhp

  • Keywords webdav, blackbelt added; webdav removed

comment:5 Changed 3 years ago by grahamperrin

  • Cc grahamperrin added

comment:6 Changed 3 months ago by kleist

see also #12343

Note: See TracTickets for help on using tickets.