summaryrefslogtreecommitdiff
path: root/content/content.c
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2003-07-16 17:38:46 +0000
committerJames Bursa <james@netsurf-browser.org>2003-07-16 17:38:46 +0000
commitc7520629b0d655bde1db9cbe0012f91502265b5d (patch)
tree017b920e26802859179aa31f8634f931e34dbc5a /content/content.c
parent6724b2c21e6b86ebce682951d427a9327d386fbc (diff)
downloadnetsurf-c7520629b0d655bde1db9cbe0012f91502265b5d.tar.gz
netsurf-c7520629b0d655bde1db9cbe0012f91502265b5d.tar.bz2
[project @ 2003-07-16 17:38:46 by bursa]
Make fetchcache return 0 on failure to parse URL. svn path=/import/netsurf/; revision=225
Diffstat (limited to 'content/content.c')
-rw-r--r--content/content.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/content/content.c b/content/content.c
index 2c7f5d00e..253caea16 100644
--- a/content/content.c
+++ b/content/content.c
@@ -121,6 +121,7 @@ struct content * content_create(char *url)
c->url = xstrdup(url);
c->type = CONTENT_UNKNOWN;
c->status = CONTENT_STATUS_TYPE_UNKNOWN;
+ c->cache = 0;
c->size = sizeof(struct content);
c->fetch = 0;
strcpy(c->status_message, "Loading");
@@ -178,6 +179,8 @@ void content_convert(struct content *c, unsigned long width, unsigned long heigh
if (handler_map[c->type].convert(c, width, height)) {
/* convert failed, destroy content */
content_broadcast(c, CONTENT_MSG_ERROR, "Conversion failed");
+ if (c->cache)
+ cache_destroy(c);
content_destroy(c);
return;
}
@@ -305,10 +308,13 @@ void content_remove_user(struct content *c,
if (c->fetch != 0)
fetch_abort(c->fetch);
if (c->status < CONTENT_STATUS_READY) {
- cache_destroy(c);
+ if (c->cache)
+ cache_destroy(c);
content_destroy(c);
- } else
- cache_freeable(c);
+ } else {
+ if (c->cache)
+ cache_freeable(c);
+ }
}
}