summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2017-07-28 16:46:23 +0100
committerJürg Billeter <j@bitron.ch>2017-07-28 16:47:42 +0100
commit0a656e9500654c247d79bfe3293a2fe16dda9d2e (patch)
tree30459e29568f79e87e11cd0d8e4cb6296970a831
parent2179f547262c1a4fc5aa31a9f08ffb07303cf16e (diff)
downloadbuildstream-0a656e9500654c247d79bfe3293a2fe16dda9d2e.tar.gz
_artifactcache/pushreceive.py: Fix stream offset check
The offset difference includes the padded bytes of the last file, i.e., up to 511 bytes in addition to the 512 byte block.
-rw-r--r--buildstream/_artifactcache/pushreceive.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/buildstream/_artifactcache/pushreceive.py b/buildstream/_artifactcache/pushreceive.py
index e0f49d03d..59cdce7ab 100644
--- a/buildstream/_artifactcache/pushreceive.py
+++ b/buildstream/_artifactcache/pushreceive.py
@@ -289,7 +289,7 @@ class PushMessageReader(object):
# Current Python tarfile stops reading after the first block.
# Read the second block as well to ensure the stream is at
# the right position for following messages.
- if tar.fileobj.tell() - filepos == 512:
+ if tar.fileobj.tell() - filepos < 1024:
tar.fileobj.read(512)
break