From 8755ceb0c809cde60b44acf74d55044315fd22e3 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Fri, 23 Jan 2004 20:46:29 +0000 Subject: [project @ 2004-01-23 20:46:29 by bursa] Add error pages for fetch failures. svn path=/import/netsurf/; revision=498 --- content/content.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'content/content.c') diff --git a/content/content.c b/content/content.c index 91481ff48..61b8cd1c9 100644 --- a/content/content.c +++ b/content/content.c @@ -342,6 +342,27 @@ void content_destroy(struct content *c) } +/** + * Reset a content. + * + * Calls the destroy function for the content, but does not free + * the structure. + */ + +void content_reset(struct content *c) +{ + assert(c != 0); + LOG(("content %p %s", c, c->url)); + if (c->type < HANDLER_MAP_COUNT) + handler_map[c->type].destroy(c); + c->type = CONTENT_UNKNOWN; + c->status = CONTENT_STATUS_TYPE_UNKNOWN; + c->size = sizeof(struct content); + free(c->mime_type); + c->mime_type = 0; +} + + /** * Display content on screen. * -- cgit v1.2.3