From 294fa48d3d452873c631b8bcf6b07d46f7fc3935 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Mon, 25 Aug 2003 16:17:11 +0000 Subject: [project @ 2003-08-25 16:17:11 by bursa] Fix 774165 (redirects with empty body). svn path=/import/netsurf/; revision=249 --- debug/netsurfd.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'debug') diff --git a/debug/netsurfd.c b/debug/netsurfd.c index f73e44954..4d21a5495 100644 --- a/debug/netsurfd.c +++ b/debug/netsurfd.c @@ -12,19 +12,21 @@ #include "netsurf/content/fetchcache.h" #include "netsurf/utils/log.h" -int done; +int done, destroyed; void callback(content_msg msg, struct content *c, void *p1, void *p2, const char *error) { LOG(("content %s, message %i", c->url, msg)); - if (msg == CONTENT_MSG_DONE || msg == CONTENT_MSG_ERROR) + if (msg == CONTENT_MSG_DONE) done = 1; + else if (msg == CONTENT_MSG_ERROR) + done = destroyed = 1; else if (msg == CONTENT_MSG_STATUS) printf("=== STATUS: %s\n", c->status_message); else if (msg == CONTENT_MSG_REDIRECT) { printf("=== REDIRECT to '%s'\n", error); - done = 1; + done = destroyed = 1; } } @@ -49,7 +51,8 @@ int main(int argc, char *argv[]) puts("=== FAILURE, dumping cache"); } cache_dump(); - content_remove_user(c, callback, 0, 0); + if (!destroyed) + content_remove_user(c, callback, 0, 0); } cache_quit(); -- cgit v1.2.3