Rev 34: Fix 'inventory.kndx' and 'revisions.kndx' files corruption. in file:///v/home/vila/src/plugins/webdav/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Wed Jun 13 21:04:33 BST 2007
At file:///v/home/vila/src/plugins/webdav/
------------------------------------------------------------
revno: 34
revision-id: v.ladeuil+lp at free.fr-20070613200432-wf3eiqdh0gr5vjeb
parent: v.ladeuil+lp at free.fr-20070507115942-7556w3g7958twdae
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: webdav
timestamp: Wed 2007-06-13 22:04:32 +0200
message:
Fix 'inventory.kndx' and 'revisions.kndx' files corruption.
* webdav.py:
(HttpDavTransport._put_bytes_ranged): Fix range description to
avoid mod_dav *ignoring* it as invalid (wrong ! wrong !) and
erasing the existing content instead of modifying the file.
modified:
webdav.py webdav.py-20060816232542-enpjxth2743ttqpq-3
-------------- next part --------------
=== modified file 'webdav.py'
--- a/webdav.py 2007-05-07 11:59:42 +0000
+++ b/webdav.py 2007-06-13 20:04:32 +0000
@@ -369,11 +369,12 @@
# objects (see handling chunked data and 100-continue).
abspath = self._real_abspath(relpath)
+ # Content-Range is start-end/size. 'size' is the file size, not the
+ # chunk size. We can't be sure about the size of the file so put '*' at
+ # the end of the range instead.
request = PUTRequest(abspath, bytes,
{'Content-Range':
- 'bytes %d-%d/%d' % (at, at+len(bytes),
- len(bytes)),
- })
+ 'bytes %d-%d/*' % (at, at+len(bytes)),})
response = self._perform(request)
code = response.code
@@ -559,7 +560,6 @@
if code == 404:
relpath_size = 0
else:
- mutter('response.headers [%r]' % response.headers)
# Consider the absence of Content-Length header as
# indicating an existing but empty file (Apache 2.0
# does this, and there is even a comment in
More information about the bazaar-commits
mailing list