From 3e2e110a86f53b391fb2d6f20487e7510de4336c Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Wed, 8 Feb 2012 00:52:16 +0000 Subject: Bypass full type sniffer if only images are acceptable svn path=/trunk/netsurf/; revision=13436 --- content/hlcache.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'content/hlcache.c') 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); -- cgit v1.2.3