- fix resumed downloads (#205723)

This commit is contained in:
Karsten Hopp 2006-09-25 15:32:19 +00:00
parent 4dc21010e0
commit ddf65cfb39
2 changed files with 65 additions and 1 deletions

View File

@ -37049,3 +37049,64 @@ diff -urN wget-1.10.2/windows/README wget-1.10.2_new/windows/README
* John Burden <john@futuresguide.com> -- 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) ||

View File

@ -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 <karsten@redhat.de> 1.10.2-6
- fix resumed downloads (#205723)
* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 1.10.2-5.1
- rebuild