summaryrefslogtreecommitdiff
path: root/content/fetchcache.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2004-07-10 02:35:31 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2004-07-10 02:35:31 +0000
commitba22b4e753529ad33a204b3c215b354aeebbbd2a (patch)
treefec7c4c6cbb98a2cc1fe825387192bf14d1d710f /content/fetchcache.c
parentc273d17ae57b4b38478f64f53ff603d2afb08b0f (diff)
downloadnetsurf-ba22b4e753529ad33a204b3c215b354aeebbbd2a.tar.gz
netsurf-ba22b4e753529ad33a204b3c215b354aeebbbd2a.tar.bz2
[project @ 2004-07-10 02:35:30 by jmb]
Use libcurl's progress callback functionality to display fetch status. This will update the status line once a second, more frequently requires hacking libcurl. svn path=/import/netsurf/; revision=1066
Diffstat (limited to 'content/fetchcache.c')
-rw-r--r--content/fetchcache.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/content/fetchcache.c b/content/fetchcache.c
index 8d3272c94..62da13106 100644
--- a/content/fetchcache.c
+++ b/content/fetchcache.c
@@ -225,9 +225,21 @@ void fetchcache_callback(fetch_msg msg, void *p, const char *data,
}
break;
+ case FETCH_PROGRESS:
+ if (size)
+ content_set_status(c,
+ messages_get("RecPercent"),
+ data, (unsigned int)size);
+ else
+ content_set_status(c,
+ messages_get("Received"),
+ data);
+ content_broadcast(c, CONTENT_MSG_STATUS, msg_data);
+ break;
+
case FETCH_DATA:
LOG(("FETCH_DATA"));
- if (c->total_size)
+/* if (c->total_size)
content_set_status(c,
messages_get("RecPercent"),
human_friendly_bytesize(c->source_size + size),
@@ -238,7 +250,7 @@ void fetchcache_callback(fetch_msg msg, void *p, const char *data,
messages_get("Received"),
human_friendly_bytesize(c->source_size + size));
content_broadcast(c, CONTENT_MSG_STATUS, msg_data);
- if (!content_process_data(c, data, size)) {
+*/ if (!content_process_data(c, data, size)) {
fetch_abort(c->fetch);
c->fetch = 0;
}