diff options
author | Jorge Arellano Cid <jcid@dillo.org> | 2009-01-23 16:49:18 -0300 |
---|---|---|
committer | Jorge Arellano Cid <jcid@dillo.org> | 2009-01-23 16:49:18 -0300 |
commit | f7f18bf2149bf544cd2b71a11b3a88aeb2b1532d (patch) | |
tree | ff28dde114825923bdb98b7d781eb728339f8685 /src/cache.c | |
parent | 3cbf18cc940ca341230c46e87de96dca06fe952b (diff) |
Bug fix: Made a_Cache_stop_client() also remove from the delayed queue.
Diffstat (limited to 'src/cache.c')
-rw-r--r-- | src/cache.c | 14 |
1 files changed, 11 insertions, 3 deletions
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"); } |