summaryrefslogtreecommitdiff
path: root/content/hlcache.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2012-02-08 00:52:16 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2012-02-08 00:52:16 +0000
commit3e2e110a86f53b391fb2d6f20487e7510de4336c (patch)
tree415612e933ef6bfae7f61f2137e549d2b1333603 /content/hlcache.c
parente2bb4aa4e01f0e3b6c4134081bd9a9bbcfe2e757 (diff)
downloadnetsurf-3e2e110a86f53b391fb2d6f20487e7510de4336c.tar.gz
netsurf-3e2e110a86f53b391fb2d6f20487e7510de4336c.tar.bz2
Bypass full type sniffer if only images are acceptable
svn path=/trunk/netsurf/; revision=13436
Diffstat (limited to 'content/hlcache.c')
-rw-r--r--content/hlcache.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/content/hlcache.c b/content/hlcache.c
index c7a803dee..a22162f50 100644
--- a/content/hlcache.c
+++ b/content/hlcache.c
@@ -522,6 +522,7 @@ nserror hlcache_llcache_callback(llcache_handle *handle,
case LLCACHE_EVENT_HAD_HEADERS:
error = mimesniff_compute_effective_type(handle, NULL, 0,
ctx->flags & HLCACHE_RETRIEVE_SNIFF_TYPE,
+ ctx->accepted_types == CONTENT_IMAGE,
&effective_type);
if (error == NSERROR_OK || error == NSERROR_NOT_FOUND) {
/* If the sniffer was successful or failed to find
@@ -545,6 +546,7 @@ nserror hlcache_llcache_callback(llcache_handle *handle,
error = mimesniff_compute_effective_type(handle,
event->data.data.buf, event->data.data.len,
ctx->flags & HLCACHE_RETRIEVE_SNIFF_TYPE,
+ ctx->accepted_types == CONTENT_IMAGE,
&effective_type);
if (error != NSERROR_OK) {
assert(0 && "MIME sniff failed with data");
@@ -561,7 +563,7 @@ nserror hlcache_llcache_callback(llcache_handle *handle,
/* DONE event before we could determine the effective MIME type.
*/
error = mimesniff_compute_effective_type(handle,
- NULL, 0, false, &effective_type);
+ NULL, 0, false, false, &effective_type);
if (error == NSERROR_OK) {
error = hlcache_migrate_ctx(ctx, effective_type);