diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2011-12-06 20:47:15 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2011-12-06 20:47:15 +0000 |
commit | 3ba6a15fa7af580d14044ab2e73318b75deb6433 (patch) | |
tree | 2a82f02f86bf015c1cfc3fd13a500b72f459b2b4 | |
parent | c673ba6c235f4aebd59474f6d0f36e412217628b (diff) | |
download | netsurf-3ba6a15fa7af580d14044ab2e73318b75deb6433.tar.gz netsurf-3ba6a15fa7af580d14044ab2e73318b75deb6433.tar.bz2 |
Fix bug #3452421: retain hlcache retrieval context when reporting errors & rely on clients correctly releasing handles to clean up.
svn path=/trunk/netsurf/; revision=13250
-rw-r--r-- | content/hlcache.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/content/hlcache.c b/content/hlcache.c index 88c88dfc9..07f07a6a8 100644 --- a/content/hlcache.c +++ b/content/hlcache.c @@ -607,9 +607,6 @@ nserror hlcache_migrate_ctx(hlcache_retrieval_ctx *ctx, content_type type = CONTENT_NONE; nserror error = NSERROR_OK; - /* Unlink the context to prevent recursion */ - RING_REMOVE(hlcache->retrieval_ctx_ring, ctx); - if (effective_type != NULL && hlcache_type_is_acceptable(effective_type, ctx->accepted_types, &type)) { @@ -623,8 +620,8 @@ nserror hlcache_migrate_ctx(hlcache_retrieval_ctx *ctx, ctx->handle->cb(ctx->handle, &hlevent, ctx->handle->pw); - llcache_handle_abort(ctx->llcache); - llcache_handle_release(ctx->llcache); + /* ctx cleaned up by client releasing handle */ + return error; } } else if (type == CONTENT_NONE && (ctx->flags & HLCACHE_RETRIEVE_MAY_DOWNLOAD)) { @@ -644,10 +641,7 @@ nserror hlcache_migrate_ctx(hlcache_retrieval_ctx *ctx, /* Ensure caller knows we need data */ error = NSERROR_NEED_DATA; } else { - /* Unacceptable type: abort fetch and report error */ - llcache_handle_abort(ctx->llcache); - llcache_handle_release(ctx->llcache); - + /* Unacceptable type: report error */ if (ctx->handle->cb != NULL) { hlcache_event hlevent; @@ -657,9 +651,13 @@ nserror hlcache_migrate_ctx(hlcache_retrieval_ctx *ctx, ctx->handle->cb(ctx->handle, &hlevent, ctx->handle->pw); } + + /* ctx cleaned up by client releasing handle */ + return NSERROR_OK; } /* No longer require retrieval context */ + RING_REMOVE(hlcache->retrieval_ctx_ring, ctx); free((char *) ctx->child.charset); free(ctx); |