From e671fe37078340b71f4829d95e242c9f6005648a Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sun, 10 Jun 2007 18:12:30 +0000 Subject: Add debug about ring sizes. Ensure we dispatch queued jobs when a job is freed. svn path=/trunk/netsurf/; revision=3333 --- content/fetch.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'content/fetch.c') 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 -- cgit v1.2.3