From fb5082605cc100b493717bce25cb6bf6123e03d0 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Fri, 3 Sep 2004 22:33:05 +0000 Subject: [project @ 2004-09-03 22:33:05 by bursa] Fix bugs relating to aborting fetches. svn path=/import/netsurf/; revision=1264 --- content/fetch.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'content') diff --git a/content/fetch.c b/content/fetch.c index a468a05a9..c072a1e5a 100644 --- a/content/fetch.c +++ b/content/fetch.c @@ -418,7 +418,14 @@ void fetch_abort(struct fetch *f) { assert(f); LOG(("fetch %p, url '%s'", f, f->url)); - f->abort = true; + if (f->queue_prev) { + f->queue_prev->queue_next = f->queue_next; + if (f->queue_next) + f->queue_next->queue_prev = f->queue_prev; + fetch_free(f); + } else { + f->abort = true; + } } @@ -579,7 +586,7 @@ void fetch_done(CURL *curl_handle, CURLcode result) callback = f->callback; p = f->p; - if (result == CURLE_OK) { + if (!abort && result == CURLE_OK) { /* fetch completed normally */ if (!f->had_headers && fetch_process_headers(f)) ; /* redirect with no body or similar */ -- cgit v1.2.3