From 6f5a59597525d694da59eaaae3bf7a14c28b3909 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Tue, 23 Jul 2019 15:26:43 -0300 Subject: [PATCH] check from final size instead of partials --- lbry/lbry/extras/daemon/Components.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lbry/lbry/extras/daemon/Components.py b/lbry/lbry/extras/daemon/Components.py index bad617470..10a1dc1a0 100644 --- a/lbry/lbry/extras/daemon/Components.py +++ b/lbry/lbry/extras/daemon/Components.py @@ -138,10 +138,10 @@ class HeadersComponent(Component): if response.status == 406 or response.content_length < self.headers.header_size: # our file is bigger log.warning("s3 is more out of date than we are") return - if response.content_length % self.headers.header_size != 0: + final_size_after_download = response.content_length + local_header_size + if final_size_after_download % self.headers.header_size != 0: log.warning("s3 appears to have corrupted header") return - final_size_after_download = response.content_length + local_header_size write_mode = "wb" if local_header_size > 0: log.info("Resuming download of %i bytes from s3", response.content_length)