summaryrefslogtreecommitdiff
path: root/src/cache.c
diff options
context:
space:
mode:
authorJorge Arellano Cid <jcid@dillo.org>2009-11-01 16:32:00 -0300
committerJorge Arellano Cid <jcid@dillo.org>2009-11-01 16:32:00 -0300
commitd8458319fcfeb7567e32f576f939c62554dedae6 (patch)
tree3dd1a56a51bc0fc703e31d6635376d5c24ed1ce8 /src/cache.c
parent252144effc180451e16e58a09de22685dd572ce4 (diff)
ftp dpi: fixed download offer, streamed transfer, added HTML feedback.
Now it behaves as HTTP. Also fixed a bug in dillo with lingering cache entries (when the file transfer was already done at abort time).
Diffstat (limited to 'src/cache.c')
-rw-r--r--src/cache.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/cache.c b/src/cache.c
index 302e9bda..fe2511d1 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -999,7 +999,7 @@ static void Cache_auth_entry(CacheEntry_t *entry, BrowserWindow *bw)
* Check whether a URL scheme is downloadable.
* Return: 1 enabled, 0 disabled.
*/
-static int Cache_download_enabled(const DilloUrl *url)
+int a_Cache_download_enabled(const DilloUrl *url)
{
if (!dStrcasecmp(URL_SCHEME(url), "http") ||
!dStrcasecmp(URL_SCHEME(url), "https") ||
@@ -1035,7 +1035,8 @@ typedef struct {
DilloUrl *url;
} Cache_savelink_t;
-/* Save link from behind a timeout so that Cache_process_queue() can
+/*
+ * Save link from behind a timeout so that Cache_process_queue() can
* get on with its work.
*/
static void Cache_savelink_cb(void *vdata)
@@ -1198,8 +1199,10 @@ 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);
+ /* Necessary when 'conn' is already done */
+ Cache_entry_remove(NULL, url);
entry = NULL;
- if (OfferDownload && Cache_download_enabled(url)) {
+ if (OfferDownload && a_Cache_download_enabled(url)) {
Cache_savelink_t *data = dNew(Cache_savelink_t, 1);
data->bw = Client_bw;
data->url = url;