webdav backend requests unnecessary properties for file listing
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Duplicity |
Fix Released
|
Medium
|
Unassigned |
Bug Description
When the the webdav backend tries to download a file listing of a directory, it sends no HTTP body in the request.
This is equivalent to requesting essentially all properties of the files in the listing. (Actually, the code has been changed here. Before the change, duplicity request all properties explicitly using "allprop". See line 117 in webdavbackend.py for a pointer to the relevant paragraph in the RFC.)
This leads to unnecessary large responses from the server that I use (sd2dav.1und1.de). The response is so large that it is even truncated after about 1.2 MB. Consequently, duplicity is not able to parse the XML in the response. I don't know if the truncating happens at client side or at server side, and I don't have the time to debug that right now.
The response can be shortended drastically by only requesting minimal information. The only information that is necessary and used by duplicity is the filename.
The attached patch solves my problem caused by truncating the reply and improves the performance of the webdav backend. It should be standards compliant but of course I don't know if it causes again problems with weird servers.
At the moment, my server sends that much per file:
<D:response xmlns:ns2="http://
<D:href>***FILENAME REDACTED*
<D:propstat>
<D:prop>
<ns2:executable
<ns666:
<ns666:
<ns666:
<ns666:
<D:getetag>
<D:creationdate
<D:getlastmodif
<D:displayname>
<D:resourcetype
<D:getcontentle
<D:getcontentty
<D:getcontentla
<D:supportedlock>
<D:lockentry>
<D:lockscope>
<D:locktype>
</D:lockentry>
<D:lockentry>
<D:lockscope>
<D:locktype>
</D:lockentry>
</D:supportedlock>
<D:lockdiscovery/>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
</D:response>
After applying the patch, it looks like that (I don't know if it's really minimal):
<D:response xmlns:lp1="DAV:" xmlns:lp2="http://
<D:href>***FILENAME REDACTED*
<D:propstat>
<D:prop>
<D:resourcetype
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
</D:response>
Changed in duplicity: | |
importance: | Undecided → Medium |
milestone: | none → 0.7.07 |
status: | New → Fix Committed |
Changed in duplicity: | |
status: | Fix Committed → Fix Released |
Thanks for including this. :)
I've just had a look at the commit. The comment just above the changed line should also be removed, because it does not apply anymore. Sorry, I did not take care of this in my patch. (And my name is misspelled in the changelog, nevermind.)