diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2010-04-08 07:09:09 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2010-04-08 07:09:09 +0000 |
commit | bba7fbbd9b8c8244ff5a410190d5f8dfac472e41 (patch) | |
tree | b52b00a531d3df13743464d103ba8d77e4b9eb26 /content | |
parent | 4682f0ccd866b86b430dbed8862ede91c1d1a061 (diff) | |
download | netsurf-bba7fbbd9b8c8244ff5a410190d5f8dfac472e41.tar.gz netsurf-bba7fbbd9b8c8244ff5a410190d5f8dfac472e41.tar.bz2 |
Abort and release llcache handle on failure to process data.
Make hlcache retrieval ignore erroneous contents.
svn path=/trunk/netsurf/; revision=10296
Diffstat (limited to 'content')
-rw-r--r-- | content/content.c | 3 | ||||
-rw-r--r-- | content/hlcache.c | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/content/content.c b/content/content.c index 1a1fc9927..2bf94431d 100644 --- a/content/content.c +++ b/content/content.c @@ -527,6 +527,9 @@ nserror content_llcache_callback(llcache_handle *llcache, if (handler_map[c->type].process_data(c, (const char *) event->data.data.buf, event->data.data.len) == false) { + llcache_handle_abort(c->llcache); + llcache_handle_release(c->llcache); + c->llcache = NULL; c->status = CONTENT_STATUS_ERROR; /** \todo It's not clear what error this is */ error = NSERROR_NOMEM; diff --git a/content/hlcache.c b/content/hlcache.c index bbe0cd753..f54ee1937 100644 --- a/content/hlcache.c +++ b/content/hlcache.c @@ -364,6 +364,7 @@ nserror hlcache_find_content(hlcache_retrieval_ctx *ctx) /* Search list of cached contents for a suitable one */ for (entry = hlcache_content_list; entry != NULL; entry = entry->next) { + hlcache_handle entry_handle = { entry, NULL, NULL }; const llcache_handle *entry_llcache; /** \todo Need to ensure that quirks mode matches */ @@ -372,6 +373,10 @@ nserror hlcache_find_content(hlcache_retrieval_ctx *ctx) if (entry->content == NULL) continue; + /* Ignore contents in the error state */ + if (content_get_status(&entry_handle) == CONTENT_STATUS_ERROR) + continue; + /* Ensure that content uses same low-level object as * low-level handle */ entry_llcache = content_get_llcache_handle(entry->content); |