From 2a6495e8ef0029d2833313034022780660d7004a Mon Sep 17 00:00:00 2001 From: Ashish Gupta Date: Wed, 31 May 2017 00:35:19 +0200 Subject: Release nightly for KolibriOS. Check board.kolibrios.org forum thread for Netsurf for more details. --- content/fetchers/file.c | 33 +++++++++++++++++++++++++++++++++ content/fetchers/httplib_kolibri.c | 8 +++++++- 2 files changed, 40 insertions(+), 1 deletion(-) (limited to 'content') diff --git a/content/fetchers/file.c b/content/fetchers/file.c index 067d9be50..1aeb40b5b 100644 --- a/content/fetchers/file.c +++ b/content/fetchers/file.c @@ -42,6 +42,21 @@ #ifdef HAVE_MMAP #include #endif + +#ifdef _TARGET_IS_KOLIBRIOS +static inline uint32_t sys_uptime(void) +{ + uint32_t uptime; + + __asm__ __volatile__( + "int $0x40 \n\t" + :"=a"(uptime) + :"a"(26),"b"(9)); + + return uptime / 100; +} +#endif + #include #include "netsurf/inttypes.h" @@ -191,6 +206,11 @@ static void fetch_file_free(void *ctx) /** callback to start a file fetch */ static bool fetch_file_start(void *ctx) { +#ifdef _TARGET_IS_KOLIBRIOS + struct fetch_file_context *c = ctx; + debug_board_printf("[%u] Starting file fetch : %s\n", sys_uptime(), nsurl_access(c->url)); +#endif + return true; } @@ -250,6 +270,9 @@ static void fetch_file_process_error(struct fetch_file_context *ctx, int code) if (fetch_file_send_callback(&msg, ctx)) goto fetch_file_process_error_aborted; +#ifdef _TARGET_IS_KOLIBRIOS + debug_board_printf("[%u] Finished file fetch : %s\n", sys_uptime(), nsurl_access(ctx->url)); +#endif msg.type = FETCH_FINISHED; fetch_file_send_callback(&msg, ctx); @@ -332,6 +355,9 @@ static void fetch_file_process_plain(struct fetch_file_context *ctx, fetch_file_send_callback(&msg, ctx); if (ctx->aborted == false) { +#ifdef _TARGET_IS_KOLIBRIOS + debug_board_printf("[%u] Finished file fetch : %s\n", sys_uptime(), nsurl_access(ctx->url)); +#endif msg.type = FETCH_FINISHED; fetch_file_send_callback(&msg, ctx); } @@ -435,6 +461,9 @@ fetch_file_process_aborted: } if (ctx->aborted == false) { +#ifdef _TARGET_IS_KOLIBRIOS + debug_board_printf("[%u] Finished file fetch : %s\n", sys_uptime(), nsurl_access(ctx->url)); +#endif msg.type = FETCH_FINISHED; fetch_file_send_callback(&msg, ctx); } @@ -741,6 +770,10 @@ static void fetch_file_process_dir(struct fetch_file_context *ctx, if (fetch_file_send_callback(&msg, ctx)) goto fetch_file_process_dir_aborted; +#ifdef _TARGET_IS_KOLIBRIOS + debug_board_printf("[%u] Finished file fetch : %s\n", sys_uptime(), nsurl_access(ctx->url)); +#endif + msg.type = FETCH_FINISHED; fetch_file_send_callback(&msg, ctx); diff --git a/content/fetchers/httplib_kolibri.c b/content/fetchers/httplib_kolibri.c index d3f268983..d5a52c30d 100644 --- a/content/fetchers/httplib_kolibri.c +++ b/content/fetchers/httplib_kolibri.c @@ -76,10 +76,14 @@ bool init_fetcher(lwc_string *scheme) { assert(lwc_string_isequal(scheme, corestring_lwc_http, &supported_scheme) == lwc_error_ok); LOG("Initializing http library!"); - if(kolibri_http_init() == 0) + debug_board_printf("---- [NETSURF] Trying to initialize http library.\n"); + if(kolibri_http_init() == 0) { LOG("[INFO] Loaded http.obj library successfully.\n"); + debug_board_printf("---- [NETSURF] Successfully initialized http library.\n"); + } else { LOG("[ERROR] Could not load http.obj library.\n"); + debug_board_printf("---- [NETSURF] Could not initialize http library. Exiting.\n"); assert(0 && 1); return false; } @@ -151,6 +155,7 @@ void *setup_fetch(struct fetch *parent_fetch, struct nsurl *url, bool start_fetch(void *httpf) { LOG("-=- start_fetch : httpf: 0x%x", httpf); + add_to_poll((struct httpfetcher *) httpf); return true; } @@ -308,6 +313,7 @@ void poll_fetch(lwc_string *scheme) { } fetch_msg msg; + msg.type = FETCH_FINISHED; msg.data.header_or_data.buf = NULL; msg.data.header_or_data.len = 0; -- cgit v1.2.3