diff options
Diffstat (limited to 'content/fetchers/about/about.c')
-rw-r--r-- | content/fetchers/about/about.c | 68 |
1 files changed, 1 insertions, 67 deletions
diff --git a/content/fetchers/about/about.c b/content/fetchers/about/about.c index e41e6c899..1bc382b57 100644 --- a/content/fetchers/about/about.c +++ b/content/fetchers/about/about.c @@ -53,6 +53,7 @@ #include "imagecache.h" #include "atestament.h" #include "config.h" +#include "choices.h" #include "about.h" typedef bool (*fetch_about_handler)(struct fetch_about_context *); @@ -289,8 +290,6 @@ static bool fetch_about_licence_handler(struct fetch_about_context *ctx) } - - /** * Handler to generate the nscolours stylesheet * @@ -337,71 +336,6 @@ aborted: /** - * Generate the text of a Choices file which represents the current - * in use options. - * - * \param ctx The fetcher context. - * \return true if handled false if aborted. - */ -static bool fetch_about_choices_handler(struct fetch_about_context *ctx) -{ - fetch_msg msg; - char buffer[1024]; - int code = 200; - int slen; - unsigned int opt_loop = 0; - int res = 0; - - /* content is going to return ok */ - fetch_set_http_code(ctx->fetchh, code); - - /* content type */ - if (fetch_about_send_header(ctx, "Content-Type: text/plain")) - goto fetch_about_choices_handler_aborted; - - msg.type = FETCH_DATA; - msg.data.header_or_data.buf = (const uint8_t *) buffer; - - slen = snprintf(buffer, sizeof buffer, - "# Automatically generated current NetSurf browser Choices\n"); - - do { - res = nsoption_snoptionf(buffer + slen, - sizeof buffer - slen, - opt_loop, - "%k:%v\n"); - if (res <= 0) - break; /* last option */ - - if (res >= (int) (sizeof buffer - slen)) { - /* last entry would not fit in buffer, submit buffer */ - msg.data.header_or_data.len = slen; - if (fetch_about_send_callback(&msg, ctx)) - goto fetch_about_choices_handler_aborted; - slen = 0; - } else { - /* normal addition */ - slen += res; - opt_loop++; - } - } while (res > 0); - - msg.data.header_or_data.len = slen; - if (fetch_about_send_callback(&msg, ctx)) - goto fetch_about_choices_handler_aborted; - - fetch_about_send_finished(ctx); - - return true; - -fetch_about_choices_handler_aborted: - return false; -} - - - - -/** * Handler to generate about scheme logo page * * \param ctx The fetcher context. |