X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Fhttp.c;h=748b4e8142a99bf28eed6d3248fd89fb61b89241;hp=247ba6748096f56153d4922a23a4314552529bb0;hb=19ef7249b8679e7a88067dca3db37e947408e15f;hpb=1d9bb1c7b05d877f7dc2f8b537feada3f2c373a3 diff --git a/src/http.c b/src/http.c index 247ba674..748b4e81 100644 --- a/src/http.c +++ b/src/http.c @@ -1626,7 +1626,7 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy, /* ... but some HTTP/1.0 caches doesn't implement Cache-Control. */ request_set_header (req, "Pragma", "no-cache", rel_none); } - if (hs->restval && !opt.timestamping) + if (hs->restval) request_set_header (req, "Range", aprintf ("bytes=%s-", number_to_static_string (hs->restval)), @@ -1986,12 +1986,14 @@ read_header: _("Malformed status line"))); CLOSE_INVALIDATE (sock); request_free (req); + xfree (head); return HERR; } if (H_10X (statcode)) { DEBUGP (("Ignoring response\n")); + xfree (head); goto read_header; } @@ -2040,8 +2042,9 @@ read_header: } } - resp_header_copy (resp, "Transfer-Encoding", hdrval, sizeof (hdrval)); - if (0 == strcasecmp (hdrval, "chunked")) + chunked_transfer_encoding = false; + if (resp_header_copy (resp, "Transfer-Encoding", hdrval, sizeof (hdrval)) + && 0 == strcasecmp (hdrval, "chunked")) chunked_transfer_encoding = true; /* Handle (possibly multiple instances of) the Set-Cookie header. */