summaryrefslogtreecommitdiff
path: root/content/fetch.c
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@netsurf-browser.org>2007-06-10 18:12:30 +0000
committerDaniel Silverstone <dsilvers@netsurf-browser.org>2007-06-10 18:12:30 +0000
commite671fe37078340b71f4829d95e242c9f6005648a (patch)
treefeef238cafd8aa0a404e8896a851f2c87747ee52 /content/fetch.c
parent87ca206e13ab4245280e0208b46b7b4b6682d2c9 (diff)
downloadnetsurf-e671fe37078340b71f4829d95e242c9f6005648a.tar.gz
netsurf-e671fe37078340b71f4829d95e242c9f6005648a.tar.bz2
Add debug about ring sizes. Ensure we dispatch queued jobs when a job is freed.
svn path=/trunk/netsurf/; revision=3333
Diffstat (limited to 'content/fetch.c')
-rw-r--r--content/fetch.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/content/fetch.c b/content/fetch.c
index a81de56f9..2c3f63700 100644
--- a/content/fetch.c
+++ b/content/fetch.c
@@ -384,6 +384,8 @@ static void fetch_dispatch_jobs(void)
}
}
fetch_active = (all_active > 0);
+ LOG(("Fetch ring is now %d elements.", all_active));
+ LOG(("Queue ring is now %d elements.", all_queued));
}
/**
@@ -509,6 +511,8 @@ fetch_send_callback(fetch_msg msg, struct fetch *fetch, const void *data,
void
fetch_can_be_freed(struct fetch *fetch)
{
+ int all_active, all_queued;
+
/* Go ahead and free the fetch properly now */
LOG(("Fetch %p, fetcher %p can be freed", fetch, fetch->fetcher_handle));
@@ -518,9 +522,17 @@ fetch_can_be_freed(struct fetch *fetch)
RING_REMOVE(queue_ring, fetch);
}
- fetch_active = (fetch_ring != NULL);
+ RING_GETSIZE(struct fetch, fetch_ring, all_active);
+ RING_GETSIZE(struct fetch, queue_ring, all_queued);
+ fetch_active = (all_active > 0);
+
+ LOG(("Fetch ring is now %d elements.", all_active));
+ LOG(("Queue ring is now %d elements.", all_queued));
+
fetch_free(fetch);
+
+ fetch_dispatch_jobs();
}
void