On Fri, Apr 11, 2008 at 02:33:50PM +0000, corvid wrote:
Jorge wrote:
Please also add a file size threshold, to avoid a dillo exit from an out of memory condition.
Does something like this sound about right?
Yes, but I'd add a WEB_RootUrl check: + if (entry->Flags & CA_HugeFile) { + AbortEntry = TRUE; + a_UIcmd_set_msg(Client_bw,"Huge file! (%dMB)", + entry->ExpectedSize / (1024*1024)); ++ if (ClientWeb->flags & WEB_RootUrl && + dStrcasecmp(URL_SCHEME(entry->Url), "file")) + OfferDownload = TRUE; + }
diff -pur dillo2/src/cache.c dillo2-cur/src/cache.c --- dillo2/src/cache.c 2008-03-29 15:14:11.000000000 +0000 +++ dillo2-cur/src/cache.c 2008-04-11 14:25:55.000000000 +0000 @@ -861,16 +861,18 @@ static void Cache_process_queue(CacheEnt } else { Client_bw->redirect_level = 0; } - if (entry->Flags & CA_HugeFile) { - a_UIcmd_set_msg(Client_bw,"Huge file! (%dMB)", - entry->ExpectedSize / (1024*1024)); - AbortEntry = OfferDownload = TRUE; - } } else { /* For non root URLs, ignore redirections and 404 answers */ if (entry->Flags & CA_Redirect || entry->Flags & CA_NotFound) Client->Callback = Cache_null_client; } + if (entry->Flags & CA_HugeFile) { + AbortEntry = TRUE; + a_UIcmd_set_msg(Client_bw,"Huge file! (%dMB)", + entry->ExpectedSize / (1024*1024)); + if (dStrcasecmp(URL_SCHEME(entry->Url), "file")) + OfferDownload = TRUE; + }
/* Set the client function */ if (!Client->Callback) {
_______________________________________________ Dillo-dev mailing list Dillo-dev@dillo.org http://lists.auriga.wearlab.de/cgi-bin/mailman/listinfo/dillo-dev
-- Cheers Jorge.-