summaryrefslogtreecommitdiff
path: root/content/fetchcache.c
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2004-03-11 02:19:14 +0000
committerJames Bursa <james@netsurf-browser.org>2004-03-11 02:19:14 +0000
commitfba46de9cbe8778919f68a7d24e242c7ee3f1331 (patch)
tree8fb266a75da3b79c2a2285d0d9e6fb8b8e9d8f91 /content/fetchcache.c
parent24da56f25d8986484d2294d8ada3348acf12c0b1 (diff)
downloadnetsurf-fba46de9cbe8778919f68a7d24e242c7ee3f1331.tar.gz
netsurf-fba46de9cbe8778919f68a7d24e242c7ee3f1331.tar.bz2
[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
Diffstat (limited to 'content/fetchcache.c')
-rw-r--r--content/fetchcache.c12
1 files changed, 5 insertions, 7 deletions
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 <bursa@users.sourceforge.net>
+ * Copyright 2004 James Bursa <bursa@users.sourceforge.net>
*/
/** \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);