From b633fd5dc9a0ecb99f799ac01559685118f4e62fa1a447ed74f9d1de7e8f86a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20M=C3=B6llers?= Date: Thu, 14 Sep 2017 09:31:41 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/network:utilities/wget?expand=0&rev=75 --- wget-416-but-file-not-complete.patch | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/wget-416-but-file-not-complete.patch b/wget-416-but-file-not-complete.patch index 6df7334..93c8c4b 100644 --- a/wget-416-but-file-not-complete.patch +++ b/wget-416-but-file-not-complete.patch @@ -2,15 +2,22 @@ Index: wget-1.19.1/src/http.c =================================================================== --- wget-1.19.1.orig/src/http.c +++ wget-1.19.1/src/http.c -@@ -3818,6 +3818,12 @@ gethttp (const struct url *u, struct url +@@ -3818,6 +3818,19 @@ gethttp (const struct url *u, struct url } } -+ // if (statcode == HTTP_STATUS_RANGE_NOT_SATISFIABLE) ++ fprintf(stderr, " hs->restval=%s\n", number_to_static_string(hs->restval)); ++ fprintf(stderr, " contlen=%s\n", number_to_static_string(contlen)); ++ fprintf(stderr, " contrange=%s\n", number_to_static_string(contrange)); ++ if (statcode == HTTP_STATUS_RANGE_NOT_SATISFIABLE ++ && hs->restval < (contlen + contrange)) + { -+ fprintf (stderr, "hs->restval=%s\n", number_to_static_string(hs->restval)); -+ fprintf (stderr, "contrange=%s\n", number_to_static_string(contrange)); -+ fprintf (stderr, "contlen=%s\n\n", number_to_static_string(contlen)); ++ /* The file was not completely downloaded, ++ yet the server claims the range is invalid. ++ Bail out. */ ++ CLOSE_INVALIDATE (sock); ++ retval = RANGEERR; ++ goto cleanup; + } if (statcode == HTTP_STATUS_RANGE_NOT_SATISFIABLE || (!opt.timestamping && hs->restval > 0 && statcode == HTTP_STATUS_OK