From ddf65cfb3933938da82b7fe4a49df58da0f2e457 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Mon, 25 Sep 2006 15:32:19 +0000 Subject: [PATCH] - fix resumed downloads (#205723) --- wget-1.10.2-to11.patch | 61 ++++++++++++++++++++++++++++++++++++++++++ wget.spec | 5 +++- 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/wget-1.10.2-to11.patch b/wget-1.10.2-to11.patch index 79ec872..b227fba 100644 --- a/wget-1.10.2-to11.patch +++ b/wget-1.10.2-to11.patch @@ -37049,3 +37049,64 @@ diff -urN wget-1.10.2/windows/README wget-1.10.2_new/windows/README * John Burden -- cleanup of the VC++ makefile to get a clean build with VC++ 5.0 on Windows 95; +--- wget-1.10.2/src/http.c.rh1 2006-09-25 17:11:55.000000000 +0200 ++++ wget-1.10.2/src/http.c 2006-09-25 17:11:59.000000000 +0200 +@@ -1762,7 +1762,7 @@ + + return RETROK; + } +- else ++ else if (!ALLOW_CLOBBER) + { + char *unique = unique_name (hs->local_file, true); + if (unique != hs->local_file) +@@ -2231,6 +2231,7 @@ + { + int count; + bool got_head = false; /* used for time-stamping */ ++ bool got_name = false; + char *tms; + const char *tmrate; + uerr_t err, ret = TRYLIMEXC; +@@ -2264,7 +2265,10 @@ + hstat.referer = referer; + + if (opt.output_document) ++ { + hstat.local_file = xstrdup (opt.output_document); ++ got_name = true; ++ } + + /* Reset the counter. */ + count = 0; +@@ -2309,13 +2313,16 @@ + /* Default document type is empty. However, if spider mode is + on or time-stamping is employed, HEAD_ONLY commands is + encoded within *dt. */ +- if ((opt.spider && !opt.recursive) || (opt.timestamping && !got_head)) ++ if ((opt.spider && !opt.recursive) ++ || (opt.timestamping && !got_head) ++ || (opt.always_rest && !got_name)) + *dt |= HEAD_ONLY; + else + *dt &= ~HEAD_ONLY; + + /* Decide whether or not to restart. */ + if (opt.always_rest ++ && got_name + && stat (hstat.local_file, &st) == 0 + && S_ISREG (st.st_mode)) + /* When -c is used, continue from on-disk size. (Can't use +@@ -2484,6 +2491,12 @@ + continue; + } + ++ if (opt.always_rest && !got_name) ++ { ++ got_name = true; ++ continue; ++ } ++ + if ((tmr != (time_t) (-1)) + && (!opt.spider || opt.recursive) + && ((hstat.len == hstat.contlen) || diff --git a/wget.spec b/wget.spec index ea4ebc6..08433a0 100644 --- a/wget.spec +++ b/wget.spec @@ -1,7 +1,7 @@ Summary: A utility for retrieving files using the HTTP or FTP protocols. Name: wget Version: 1.10.2 -Release: 5.1 +Release: 6 License: GPL Group: Applications/Internet Url: http://wget.sunsite.dk/ @@ -71,6 +71,9 @@ rm -rf $RPM_BUILD_ROOT %{_infodir}/* %changelog +* Mon Sep 25 2006 Karsten Hopp 1.10.2-6 +- fix resumed downloads (#205723) + * Wed Jul 12 2006 Jesse Keating - 1.10.2-5.1 - rebuild