summaryrefslogtreecommitdiff
path: root/content/fetchers/about.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2011-09-29 15:31:54 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2011-09-29 15:31:54 +0000
commit6cfd37e60f0181916906de67c9f86cf54ab565c2 (patch)
treed68c3e909b2f1f4a1403c8af73fb68d0e33fc97e /content/fetchers/about.c
parent828d8e0de8a643f74ddd019bd8afe663c65540e9 (diff)
downloadnetsurf-6cfd37e60f0181916906de67c9f86cf54ab565c2.tar.gz
netsurf-6cfd37e60f0181916906de67c9f86cf54ab565c2.tar.bz2
Convert fetchers to nsurl.
svn path=/trunk/netsurf/; revision=12910
Diffstat (limited to 'content/fetchers/about.c')
-rw-r--r--content/fetchers/about.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/content/fetchers/about.c b/content/fetchers/about.c
index 2a5475d97..cf36f3543 100644
--- a/content/fetchers/about.c
+++ b/content/fetchers/about.c
@@ -68,7 +68,7 @@ struct fetch_about_context {
bool aborted; /**< Flag indicating fetch has been aborted */
bool locked; /**< Flag indicating entry is already entered */
- char *url; /**< The full url the fetch refers to */
+ nsurl *url; /**< The full url the fetch refers to */
fetch_about_handler handler;
};
@@ -396,6 +396,7 @@ struct about_handlers {
bool hidden; /* Flag indicating if entry should be show in listing */
};
+/* TODO: lwc_string identifiers, since they're compared to an lwc_string */
struct about_handlers about_handler_list[] = {
{ "credits", fetch_about_credits_handler, false },
{ "licence", fetch_about_licence_handler, false },
@@ -501,7 +502,7 @@ static void fetch_about_finalise(lwc_string *scheme)
/** callback to set up a about fetch context. */
static void *
fetch_about_setup(struct fetch *fetchh,
- const char *url,
+ nsurl *url,
bool only_2xx,
const char *post_urlenc,
const struct fetch_multipart_data *post_multipart,
@@ -509,25 +510,27 @@ fetch_about_setup(struct fetch *fetchh,
{
struct fetch_about_context *ctx;
unsigned int handler_loop;
- struct url_components urlcomp;
+ lwc_string *path;
ctx = calloc(1, sizeof(*ctx));
if (ctx == NULL)
return NULL;
- url_get_components(url, &urlcomp);
+ path = nsurl_get_component(url, NSURL_PATH);
for (handler_loop = 0;
handler_loop < about_handler_list_len;
handler_loop++) {
ctx->handler = about_handler_list[handler_loop].handler;
- if (strcmp(about_handler_list[handler_loop].name, urlcomp.path) == 0)
+ if (strcmp(about_handler_list[handler_loop].name,
+ lwc_string_data(path)) == 0)
break;
}
- url_destroy_components(&urlcomp);
+ lwc_string_unref(path);
ctx->fetchh = fetchh;
+ ctx->url = nsurl_ref(url);
RING_INSERT(ring, ctx);
@@ -538,7 +541,7 @@ fetch_about_setup(struct fetch *fetchh,
static void fetch_about_free(void *ctx)
{
struct fetch_about_context *c = ctx;
- free(c->url);
+ nsurl_unref(c->url);
RING_REMOVE(ring, c);
free(ctx);
}