From ba22b4e753529ad33a204b3c215b354aeebbbd2a Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sat, 10 Jul 2004 02:35:31 +0000 Subject: [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 --- content/fetchcache.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'content/fetchcache.c') 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; } -- cgit v1.2.3