summaryrefslogtreecommitdiff
path: root/content/hlcache.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2011-09-28 11:26:30 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2011-09-28 11:26:30 +0000
commit861f88aa43cebd6dbfd0ecde175a4e81b995c2a1 (patch)
tree296e3131f01f2bab55a32756f5500c6f0337b545 /content/hlcache.c
parent970d6dd835d4db60d6264bf3ff1a7553cb683723 (diff)
downloadnetsurf-861f88aa43cebd6dbfd0ecde175a4e81b995c2a1.tar.gz
netsurf-861f88aa43cebd6dbfd0ecde175a4e81b995c2a1.tar.bz2
Port llcache to nsurl.
svn path=/trunk/netsurf/; revision=12904
Diffstat (limited to 'content/hlcache.c')
-rw-r--r--content/hlcache.c30
1 files changed, 29 insertions, 1 deletions
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;