diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | src/cache.c | 1 | ||||
-rw-r--r-- | src/capi.c | 11 |
3 files changed, 9 insertions, 4 deletions
@@ -18,6 +18,7 @@ dillo-2.2 [??] - Fixed a bug with OPTION element (it was parsing entities twice). - Bugfix: remove the empty cache entry lingering after connection abort. - Switched capi to use dlib's Dlist instead of a_List_* methods. + - Remove empty cache entries on Stop-button press and new link request! Patches: Jorge Arellano Cid +- Fix segfault from AREA when MAP is missing name attribute. - Fix image map coordinates when margin/border/padding present. diff --git a/src/cache.c b/src/cache.c index baf5505c..b984766b 100644 --- a/src/cache.c +++ b/src/cache.c @@ -1180,7 +1180,6 @@ static CacheEntry_t *Cache_process_queue(CacheEntry_t *entry) /* Abort the entry, remove it from cache, and maybe offer download. */ DilloUrl *url = a_Url_dup(entry->Url); a_Capi_conn_abort_by_url(url); - Cache_entry_remove(entry, NULL); entry = NULL; if (OfferDownload && Cache_download_enabled(url)) { a_UIcmd_save_link(Client_bw, url); @@ -184,6 +184,7 @@ static void Capi_conn_resume(void) /* * Abort the connection for a given url, using its CCC. + * (OpAbort 2,BCK removes the cache entry) */ void a_Capi_conn_abort_by_url(const DilloUrl *url) { @@ -515,7 +516,11 @@ void a_Capi_stop_client(int Key, int force) { CacheClient_t *Client; - if (force && (Client = a_Cache_client_get_if_unique(Key))) { + _MSG("a_Capi_stop_client: force=%d\n", force); + + Client = a_Cache_client_get_if_unique(Key); + if (Client && (force || Client->BufSize == 0)) { + /* remove empty entries too */ a_Capi_conn_abort_by_url(Client->Url); } a_Cache_stop_client(Key); @@ -590,8 +595,6 @@ void a_Capi_ccc(int Op, int Branch, int Dir, ChainLink *Info, case OpAbort: conn = Info->LocalKey; conn->InfoSend = NULL; - /* remove the cache entry for this URL */ - a_Cache_entry_remove_by_url(conn->url); if (Data2) { if (!strcmp(Data2, "DpidERROR")) { a_UIcmd_set_msg(conn->bw, @@ -638,6 +641,8 @@ void a_Capi_ccc(int Op, int Branch, int Dir, ChainLink *Info, conn = Info->LocalKey; conn->InfoRecv = NULL; a_Chain_bcb(OpAbort, Info, NULL, NULL); + /* remove the cache entry for this URL */ + a_Cache_entry_remove_by_url(conn->url); Capi_conn_unref(conn); dFree(Info); break; |