From f7f18bf2149bf544cd2b71a11b3a88aeb2b1532d Mon Sep 17 00:00:00 2001 From: Jorge Arellano Cid Date: Fri, 23 Jan 2009 16:49:18 -0300 Subject: Bug fix: Made a_Cache_stop_client() also remove from the delayed queue. --- src/cache.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/cache.c b/src/cache.c index b03c96c2..8fd9f524 100644 --- a/src/cache.c +++ b/src/cache.c @@ -1254,15 +1254,23 @@ CacheClient_t *a_Cache_client_get_if_unique(int Key) void a_Cache_stop_client(int Key) { CacheClient_t *Client; + CacheEntry_t *entry; DICacheEntry *DicEntry; + /* The client can be in both queues at the same time */ if ((Client = dList_find_custom(ClientQueue, INT2VOIDP(Key), Cache_client_by_key_cmp))) { - DicEntry = a_Dicache_get_entry(Client->Url, Client->Version); - if (DicEntry) { + /* Dicache */ + if ((DicEntry = a_Dicache_get_entry(Client->Url, Client->Version))) a_Dicache_unref(Client->Url, Client->Version); - } + + /* DelayedQueue */ + if ((entry = Cache_entry_search(Client->Url))) + dList_remove(DelayedQueue, entry); + + /* Main queue */ Cache_client_dequeue(Client, NULLKey); + } else { _MSG("WARNING: Cache_stop_client, nonexistent client\n"); } -- cgit v1.2.3