summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2012-07-21 13:12:51 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2012-07-21 13:12:51 +0100
commita2dadbbe1261ec89fc6b05f356baef06efdc6df7 (patch)
tree2cb6c201d50edb55a8a2f74518acf3943caa9ee6
parent02561162a9f4b3ded49cea72cd23b4b102092db8 (diff)
downloadnetsurf-a2dadbbe1261ec89fc6b05f356baef06efdc6df7.tar.gz
netsurf-a2dadbbe1261ec89fc6b05f356baef06efdc6df7.tar.bz2
Add about:welcome handler and enable resource:welcome.html.
-rw-r--r--content/fetchers/about.c22
-rw-r--r--content/fetchers/resource.c1
2 files changed, 21 insertions, 2 deletions
diff --git a/content/fetchers/about.c b/content/fetchers/about.c
index eddd77ef0..1330217f9 100644
--- a/content/fetchers/about.c
+++ b/content/fetchers/about.c
@@ -548,6 +548,21 @@ static bool fetch_about_logo_handler(struct fetch_about_context *ctx)
return true;
}
+static bool fetch_about_welcome_handler(struct fetch_about_context *ctx)
+{
+ fetch_msg msg;
+
+ /* content is going to return redirect */
+ fetch_set_http_code(ctx->fetchh, 302);
+
+ msg.type = FETCH_REDIRECT;
+ msg.data.redirect = "resource:welcome.html";
+
+ fetch_about_send_callback(&msg, ctx);
+
+ return true;
+}
+
/* Forward declaration because this handler requires the handler table. */
static bool fetch_about_about_handler(struct fetch_about_context *ctx);
@@ -560,13 +575,15 @@ struct about_handlers {
};
/** List of about paths and their handlers */
-struct about_handlers about_handler_list[] = {
+struct about_handlers about_handler_list[] = {
{ "credits", SLEN("credits"), NULL,
fetch_about_credits_handler, false },
{ "licence", SLEN("licence"), NULL,
fetch_about_licence_handler, false },
{ "license", SLEN("license"), NULL,
fetch_about_licence_handler, true },
+ { "welcome", SLEN("welcome"), NULL,
+ fetch_about_welcome_handler, false },
{ "config", SLEN("config"), NULL,
fetch_about_config_handler, false },
{ "Choices", SLEN("Choices"), NULL,
@@ -585,7 +602,8 @@ struct about_handlers about_handler_list[] = {
fetch_about_blank_handler, true }
};
-#define about_handler_list_len (sizeof(about_handler_list) / sizeof(struct about_handlers))
+#define about_handler_list_len (sizeof(about_handler_list) / \
+ sizeof(struct about_handlers))
/**
* List all the valid about: paths available
diff --git a/content/fetchers/resource.c b/content/fetchers/resource.c
index 1cd04f2dd..86d5498d5 100644
--- a/content/fetchers/resource.c
+++ b/content/fetchers/resource.c
@@ -79,6 +79,7 @@ static const char *fetch_resource_paths[] = {
"user.css",
"credits.html",
"licence.html",
+ "welcome.html",
"favicon.ico",
"netsurf.png"
};