From: Micah Cowan Date: Tue, 17 Jun 2008 04:49:15 +0000 (-0700) Subject: Don't abort when len > contlen, when we set it that way. X-Git-Tag: v1.13~421^2~9 X-Git-Url: http://sjero.net/git/?p=wget;a=commitdiff_plain;h=c94d559bc3a2f193fb6ac3a0d78cf9f7ce40fdae Don't abort when len > contlen, when we set it that way. --- diff --git a/src/ChangeLog b/src/ChangeLog index ae04028d..deee0232 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2008-06-16 Micah Cowan + + * http.c (http_loop): When hstat.len is higher than the + successfully completed content's length, but it's because we + _set_ it that way, don't abort. + 2008-06-13 Micah Cowan * build_info.c: ENABLE_NTLM, not HAVE_NTLM; distinguish OpenSSL diff --git a/src/http.c b/src/http.c index 919d7593..78e57373 100644 --- a/src/http.c +++ b/src/http.c @@ -2800,10 +2800,18 @@ Remote file exists.\n\n")); printwhat (count, opt.ntry); continue; } - else + else if (hstat.len != hstat.restval) /* Getting here would mean reading more data than requested with content-length, which we never do. */ abort (); + else + { + /* Getting here probably means that the content-length was + * _less_ than the original, local size. We should probably + * truncate or re-read, or something. FIXME */ + ret = RETROK; + goto exit; + } } else /* from now on hstat.res can only be -1 */ {