From 861f88aa43cebd6dbfd0ecde175a4e81b995c2a1 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Wed, 28 Sep 2011 11:26:30 +0000 Subject: Port llcache to nsurl. svn path=/trunk/netsurf/; revision=12904 --- content/hlcache.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'content/hlcache.c') diff --git a/content/hlcache.c b/content/hlcache.c index db25f08ad..f7da968b5 100644 --- a/content/hlcache.c +++ b/content/hlcache.c @@ -233,6 +233,8 @@ nserror hlcache_handle_retrieve(const char *url, uint32_t flags, { hlcache_retrieval_ctx *ctx; nserror error; + nsurl *nsref = NULL; + nsurl *nsurl; assert(cb != NULL); @@ -264,16 +266,42 @@ nserror hlcache_handle_retrieve(const char *url, uint32_t flags, ctx->handle->cb = cb; ctx->handle->pw = pw; - error = llcache_handle_retrieve(url, flags, referer, post, + error = nsurl_create(url, &nsurl); + if (error != NSERROR_OK) { + free((char *) ctx->child.charset); + free(ctx->handle); + free(ctx); + return error; + } + + if (referer != NULL) { + error = nsurl_create(referer, &nsref); + if (error != NSERROR_OK) { + free((char *) ctx->child.charset); + free(ctx->handle); + free(ctx); + nsurl_unref(nsurl); + return error; + } + } + + error = llcache_handle_retrieve(nsurl, flags, nsref, post, hlcache_llcache_callback, ctx, &ctx->llcache); if (error != NSERROR_OK) { + nsurl_unref(nsurl); + if (nsref != NULL) + nsurl_unref(nsref); free((char *) ctx->child.charset); free(ctx->handle); free(ctx); return error; } + nsurl_unref(nsurl); + if (nsref != NULL) + nsurl_unref(nsref); + RING_INSERT(hlcache->retrieval_ctx_ring, ctx); *result = ctx->handle; -- cgit v1.2.3