From fba46de9cbe8778919f68a7d24e242c7ee3f1331 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Thu, 11 Mar 2004 02:19:14 +0000 Subject: [project @ 2004-03-11 02:19:13 by bursa] Add source_data to content structure and remove equivalents from individual contents. svn path=/import/netsurf/; revision=606 --- content/fetchcache.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'content/fetchcache.c') diff --git a/content/fetchcache.c b/content/fetchcache.c index 21b50ee0b..3ac499c07 100644 --- a/content/fetchcache.c +++ b/content/fetchcache.c @@ -2,7 +2,7 @@ * This file is part of NetSurf, http://netsurf.sourceforge.net/ * Licensed under the GNU General Public License, * http://www.opensource.org/licenses/gpl-license - * Copyright 2003 James Bursa + * Copyright 2004 James Bursa */ /** \file @@ -108,7 +108,6 @@ struct content * fetchcache(const char *url, char *referer, #endif cache_put(c); - c->fetch_size = 0; c->width = width; c->height = height; c->no_error_pages = no_error_pages; @@ -169,17 +168,16 @@ void fetchcache_callback(fetch_msg msg, void *p, char *data, unsigned long size) case FETCH_DATA: LOG(("FETCH_DATA")); - c->fetch_size += size; if (c->total_size) sprintf(c->status_message, messages_get("RecPercent"), - c->fetch_size, c->total_size, - (unsigned int) (c->fetch_size * + c->source_size + size, c->total_size, + (unsigned int) ((c->source_size + size) * 100.0 / c->total_size)); else sprintf(c->status_message, messages_get("Received"), - c->fetch_size); + c->source_size + size); content_broadcast(c, CONTENT_MSG_STATUS, 0); content_process_data(c, data, size); break; @@ -187,7 +185,7 @@ void fetchcache_callback(fetch_msg msg, void *p, char *data, unsigned long size) case FETCH_FINISHED: LOG(("FETCH_FINISHED")); sprintf(c->status_message, messages_get("Converting"), - c->fetch_size); + c->source_size); c->fetch = 0; content_broadcast(c, CONTENT_MSG_STATUS, 0); content_convert(c, c->width, c->height); -- cgit v1.2.3