From 0a656e9500654c247d79bfe3293a2fe16dda9d2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Billeter?= Date: Fri, 28 Jul 2017 16:46:23 +0100 Subject: _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. --- buildstream/_artifactcache/pushreceive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.1