summaryrefslogtreecommitdiff
path: root/content/fetchers/file.c
diff options
context:
space:
mode:
authorAshish Gupta <ashmew2@gmail.com>2017-05-31 00:35:19 +0200
committerAshish Gupta <ashmew2@gmail.com>2017-06-10 08:25:29 +0200
commit4b208e24000f7e449be4c00c0e89ce66b85880f5 (patch)
tree5748a824b4f3d00fc813567c72156a506426a232 /content/fetchers/file.c
parentc8a2d24a43607dcc2f3e09cb33633eb6d6f29b9f (diff)
downloadnetsurf-4b208e24000f7e449be4c00c0e89ce66b85880f5.tar.gz
netsurf-4b208e24000f7e449be4c00c0e89ce66b85880f5.tar.bz2
Release nightly for KolibriOS.
Check board.kolibrios.org forum thread for Netsurf for more details.
Diffstat (limited to 'content/fetchers/file.c')
-rw-r--r--content/fetchers/file.c33
1 files changed, 33 insertions, 0 deletions
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 <sys/mman.h>
#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 <libwapcaplet/libwapcaplet.h>
#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);