From 697be91e3bad5f8c3d4384cdfe43492e7fe24e0a Mon Sep 17 00:00:00 2001 From: James Bursa Date: Sun, 28 Mar 2004 17:18:52 +0000 Subject: [project @ 2004-03-28 17:18:52 by bursa] Fix for errors with compressed content. svn path=/import/netsurf/; revision=689 --- content/fetch.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'content') diff --git a/content/fetch.c b/content/fetch.c index 836122eb4..5f6f0015c 100644 --- a/content/fetch.c +++ b/content/fetch.c @@ -57,6 +57,7 @@ struct fetch { bool had_headers; /**< Headers have been processed. */ int locked; /**< Lock count. */ bool aborting; /**< Abort requested in callback. */ + bool stopped; /**< Download stopped on purpose. */ bool only_2xx; /**< Only HTTP 2xx responses acceptable. */ bool cookies; /**< Send & accept cookies. */ char *url; /**< URL. */ @@ -228,6 +229,7 @@ struct fetch * fetch_start(char *url, char *referer, fetch->had_headers = false; fetch->locked = 0; fetch->aborting = false; + fetch->stopped = false; fetch->only_2xx = only_2xx; fetch->cookies = cookies; fetch->url = strdup(url); @@ -548,7 +550,7 @@ void fetch_done(CURL *curl_handle, CURLcode result) ; /* redirect with no body or similar */ else finished = true; - } else if (result == CURLE_WRITE_ERROR) + } else if (result == CURLE_WRITE_ERROR && f->stopped) /* CURLE_WRITE_ERROR occurs when fetch_curl_data * returns 0, which we use to abort intentionally */ ; @@ -578,6 +580,7 @@ size_t fetch_curl_data(void * data, size_t size, size_t nmemb, struct fetch *f) if (!f->had_headers && fetch_process_headers(f)) { f->locked--; + f->stopped = true; return 0; } -- cgit v1.2.3