packages/s3ql: correctly send body length for plain data
This commit is contained in:
parent
6f6883f4a1
commit
dd2633413a
1 changed files with 26 additions and 0 deletions
26
patches/base/s3ql/fix-plain-block-size.patch
Normal file
26
patches/base/s3ql/fix-plain-block-size.patch
Normal file
|
@ -0,0 +1,26 @@
|
|||
diff --git a/src/s3ql/backends/comprenc.py b/src/s3ql/backends/comprenc.py
|
||||
index 6402fec1..9ed3627e 100644
|
||||
--- a/src/s3ql/backends/comprenc.py
|
||||
+++ b/src/s3ql/backends/comprenc.py
|
||||
@@ -276,7 +276,7 @@ class ComprencBackend(AbstractBackend):
|
||||
buf.seek(0)
|
||||
fh = buf
|
||||
|
||||
- return self.backend.write_fh(key, fh, meta_raw)
|
||||
+ return self.backend.write_fh(key, fh, meta_raw, len_=len_ if meta_raw['compression'] == 'None'and meta_raw['encryption'] == 'None' else None)
|
||||
|
||||
def contains(self, key):
|
||||
return self.backend.contains(key)
|
||||
diff --git a/src/s3ql/database.py b/src/s3ql/database.py
|
||||
index bb4054e6..c2142bf6 100644
|
||||
--- a/src/s3ql/database.py
|
||||
+++ b/src/s3ql/database.py
|
||||
@@ -659,7 +659,7 @@ def upload_metadata(
|
||||
)
|
||||
obj = METADATA_OBJ_NAME % (blockno, params.seq_no)
|
||||
fh.seek(blockno * blocksize)
|
||||
- backend.write_fh(obj, fh, len_=blocksize)
|
||||
+ backend.write_fh(obj, fh, len_=min(blocksize, db_size - blockno * blocksize))
|
||||
|
||||
if not update_params:
|
||||
return
|
Loading…
Reference in a new issue