summaryrefslogtreecommitdiff
path: root/content/fetchers/resource.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2011-02-23 22:41:17 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2011-02-23 22:41:17 +0000
commit308f549f7849da791ca1b52df67fcf0ccc09e6af (patch)
treeef3df721eaf3b8498029dbde0874810a07896153 /content/fetchers/resource.c
parent79d9d6abab46d5b530efa863670daca0c68ffee5 (diff)
downloadnetsurf-308f549f7849da791ca1b52df67fcf0ccc09e6af.tar.gz
netsurf-308f549f7849da791ca1b52df67fcf0ccc09e6af.tar.bz2
Fix backend fetcher poll loops
svn path=/trunk/netsurf/; revision=11775
Diffstat (limited to 'content/fetchers/resource.c')
-rw-r--r--content/fetchers/resource.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/content/fetchers/resource.c b/content/fetchers/resource.c
index 2818305d0..c8fb060b6 100644
--- a/content/fetchers/resource.c
+++ b/content/fetchers/resource.c
@@ -234,10 +234,6 @@ static void fetch_resource_poll(const char *scheme)
/* Iterate over ring, processing each pending fetch */
c = ring;
do {
- /* Take a copy of the next pointer as we may destroy
- * the ring item we're currently processing */
- next = c->r_next;
-
/* Ignore fetches that have been flagged as locked.
* This allows safe re-entrant calls to this function.
* Re-entrancy can occur if, as a result of a callback,
@@ -245,6 +241,7 @@ static void fetch_resource_poll(const char *scheme)
* again.
*/
if (c->locked == true) {
+ next = c->r_next;
continue;
}
@@ -254,6 +251,10 @@ static void fetch_resource_poll(const char *scheme)
c->handler(c);
}
+ /* Compute next fetch item at the last possible moment
+ * as processing this item may have added to the ring
+ */
+ next = c->r_next;
fetch_remove_from_queues(c->fetchh);
fetch_free(c->fetchh);