1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-29 03:17:53 -04:00

Use cache if at all possible if CACHE_MODE_ALWAYS

In load_uri, if there is no valid cache entry and no existing connection
for the requested URI, make one last check in case there is an
incomplete cache entry.
This commit is contained in:
Miciah Dashiel Butler Masters 2008-07-12 05:46:49 +00:00
parent 60c50ea378
commit d16e0c974f

View File

@ -996,6 +996,19 @@ load_uri(struct uri *uri, struct uri *referrer, struct download *download,
return 0;
}
if (download && cache_mode == CACHE_MODE_ALWAYS) {
cached = find_in_cache(uri);
if (cached) {
download->cached = cached;
download->state = connection_state(S_OK);
if (download->callback)
download->callback(download, download->data);
if (proxy_uri) done_uri(proxy_uri);
if (proxied_uri) done_uri(proxied_uri);
return 0;
}
}
conn = init_connection(proxy_uri, proxied_uri, referrer, start, cache_mode, pri);
if (!conn) {
if (download) {