summaryrefslogtreecommitdiff
path: root/frontends/monkey/download.c
diff options
context:
space:
mode:
Diffstat (limited to 'frontends/monkey/download.c')
-rw-r--r--frontends/monkey/download.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/frontends/monkey/download.c b/frontends/monkey/download.c
index 5c9ce1b53..b9ca1746f 100644
--- a/frontends/monkey/download.c
+++ b/frontends/monkey/download.c
@@ -25,6 +25,7 @@
#include "netsurf/download.h"
#include "desktop/download.h"
+#include "monkey/output.h"
#include "monkey/browser.h"
static uint32_t dwin_ctr = 0;
@@ -33,6 +34,7 @@ struct gui_download_window {
struct gui_download_window *r_next;
struct gui_download_window *r_prev;
struct gui_window *g;
+ download_context *dlctx;
uint32_t dwin_num;
char *host; /* ignore */
};
@@ -48,11 +50,12 @@ gui_download_window_create(download_context *ctx,
return NULL;
ret->g = parent;
ret->dwin_num = dwin_ctr++;
+ ret->dlctx = ctx;
RING_INSERT(dw_ring, ret);
- fprintf(stdout, "DOWNLOAD_WINDOW CREATE DWIN %u WIN %u\n",
- ret->dwin_num, parent->win_num);
+ moutf(MOUT_DOWNLOAD, "CREATE DWIN %u WIN %u",
+ ret->dwin_num, parent->win_num);
return ret;
}
@@ -61,7 +64,7 @@ static nserror
gui_download_window_data(struct gui_download_window *dw,
const char *data, unsigned int size)
{
- fprintf(stdout, "DOWNLOAD_WINDOW DATA DWIN %u SIZE %u DATA %s\n",
+ moutf(MOUT_DOWNLOAD, "DATA DWIN %u SIZE %u DATA %s",
dw->dwin_num, size, data);
return NSERROR_OK;
}
@@ -70,16 +73,15 @@ static void
gui_download_window_error(struct gui_download_window *dw,
const char *error_msg)
{
- fprintf(stdout, "DOWNLOAD_WINDOW ERROR DWIN %u ERROR %s\n",
- dw->dwin_num, error_msg);
+ moutf(MOUT_DOWNLOAD, "ERROR DWIN %u ERROR %s", dw->dwin_num, error_msg);
}
static void
gui_download_window_done(struct gui_download_window *dw)
{
- fprintf(stdout, "DOWNLOAD_WINDOW DONE DWIN %u\n",
- dw->dwin_num);
+ moutf(MOUT_DOWNLOAD, "DONE DWIN %u", dw->dwin_num);
RING_REMOVE(dw_ring, dw);
+ download_context_destroy(dw->dlctx);
free(dw);
}