diff --git a/programs/network/netsurf/netsurf/content/fetchers/curl.c b/programs/network/netsurf/netsurf/content/fetchers/curl.c index 90dd29474e..6e3bf39d9d 100644 --- a/programs/network/netsurf/netsurf/content/fetchers/curl.c +++ b/programs/network/netsurf/netsurf/content/fetchers/curl.c @@ -216,7 +216,12 @@ void * fetch_curl_setup (struct fetch *fetchh, if (ctx == NULL) return NULL; - ctx->path = url_to_path(nsurl_access(url)); + //ctx->path = url_to_path(nsurl_access(url)); + char *zz; + int pr; + nsurl_get(url, NSURL_WITH_FRAGMENT, &zz, &pr); + + ctx->path = zz; if (ctx->path == NULL) { free(ctx); return NULL; @@ -343,12 +348,85 @@ fetch_file_process_error_aborted: } +int is_pid(int k) +{ + int error; +asm volatile ("int $0x40":"=a"(error):"a"(18), "b"(21), "c"(k)); +return error; +} + + +int kill_pid(int k) +{ + int error; +asm volatile ("int $0x40":"=a"(error):"a"(18), "b"(18), "c"(k)); +return error; +} + static void fetch_curl_process(struct fetch_curl_context *ctx) { + int pid=execl ("/sys/network/downloader", ctx->path, 0); + + + +// while (is_pid(pid)) { + kill_pid(pid); +// } + + pid=execl ("/sys/network/downloader", ctx->path, 0); + + char ps[255]; + sprintf(ps, "pid %d", pid); + execl ("/sys/network/@notify", ps, 0); + + + while (is_pid(pid)); + + + sprintf(ps, "Yay! Finished"); + execl ("/sys/network/@notify", ps, 0); + + + /* + char pzz[255]; + sprintf(pzz, "Pid is %d", pid); + execl ("/sys/@notify", pzz, 0); */ + //int status; + //waitpid(pid, &status, 0); + + fetch_msg msg; - const char * buf = "