changeset 812:6a5bff4e66b7

Bug fix: Made a_Cache_stop_client() also remove from the delayed queue.
author Jorge Arellano Cid <jcid@dillo.org>
date Fri, 23 Jan 2009 16:49:18 -0300
parents 693e90600bc1
children 7437a4d4928d
files src/cache.c
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/cache.c	Fri Jan 23 15:21:45 2009 -0300
+++ b/src/cache.c	Fri Jan 23 16:49:18 2009 -0300
@@ -1254,15 +1254,23 @@
 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");
    }