From 6d0795b9235b6752c76ca3ec0275760c4aa4da58 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sun, 18 Mar 2007 13:02:07 +0000 Subject: Handle redirects with partial bodies. svn path=/trunk/netsurf/; revision=3209 --- content/fetch.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/content/fetch.c b/content/fetch.c index fc686ace1..ddffef93a 100644 --- a/content/fetch.c +++ b/content/fetch.c @@ -915,6 +915,14 @@ void fetch_done(CURL *curl_handle, CURLcode result) ; /* redirect with no body or similar */ else finished = true; + } else if (result == CURLE_PARTIAL_FILE) { + /* CURLE_PARTIAL_FILE occurs if the received body of a + * response is smaller than that specified in the + * Content-Length header. */ + if (!f->had_headers && fetch_process_headers(f)) + ; /* redirect with partial body, or similar */ + else + error = true; } else if (result == CURLE_WRITE_ERROR && f->stopped) /* CURLE_WRITE_ERROR occurs when fetch_curl_data * returns 0, which we use to abort intentionally */ -- cgit v1.2.3