diff options
author | James Bursa <james@netsurf-browser.org> | 2004-03-28 17:18:52 +0000 |
---|---|---|
committer | James Bursa <james@netsurf-browser.org> | 2004-03-28 17:18:52 +0000 |
commit | 697be91e3bad5f8c3d4384cdfe43492e7fe24e0a (patch) | |
tree | 0fff5fa44eacbbc1b568bdc44fff01233b3e9fd2 /content | |
parent | 8052ed8c6c749270010c7182de560ba5c72fcabc (diff) | |
download | netsurf-697be91e3bad5f8c3d4384cdfe43492e7fe24e0a.tar.gz netsurf-697be91e3bad5f8c3d4384cdfe43492e7fe24e0a.tar.bz2 |
[project @ 2004-03-28 17:18:52 by bursa]
Fix for errors with compressed content.
svn path=/import/netsurf/; revision=689
Diffstat (limited to 'content')
-rw-r--r-- | content/fetch.c | 5 |
1 files changed, 4 insertions, 1 deletions
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; } |