From 78d194cb77db00a530779aa2a1e8d2ef9707d229 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Mon, 28 Jan 2008 01:35:00 +0000 Subject: Rework handling of HTTP redirects -- we now count the number of redirects followed for a given item and abort if a fixed limit is reached. This fixes sites which have pages that redirect to themselves. Redirect handling is now transparent to clients of fetchcache. The new scheme works as follows: 1) Request content for URL (fetchcache() 2) Start fetch of content (fetchcache_go() 3) If no redirect, continue through LOADING, READY, DONE etc. states as before If redirect, receive NEWPTR for each redirect that occurs, then continue through LOADING, READY, DONE etc. states as before. The upshot of this is that redirects result in extra contents being created. It also means that, until LOADING has been received, the content (and thus the URL being fetched) may change. Therefore, fetchcache clients should expect to have to deal with transient data prior to LOADING occurring. As a necessary side-effect of this, the HTML object URLs and CSS @import URLs are no longer stored alongside the relevant contents. These URLs can be accessed by interrogating the url member of struct content anyway, so it was a rather redundant scheme before. svn path=/trunk/netsurf/; revision=3787 --- riscos/plugin.c | 9 --------- 1 file changed, 9 deletions(-) (limited to 'riscos/plugin.c') diff --git a/riscos/plugin.c b/riscos/plugin.c index aea4ad93d..19f0f106f 100644 --- a/riscos/plugin.c +++ b/riscos/plugin.c @@ -1704,14 +1704,6 @@ void plugin_stream_callback(content_msg msg, struct content *c, plugin_STREAM_DESTROY_ERROR); break; - case CONTENT_MSG_REDIRECT: - /* and re-start fetch with new URL */ - p->c = 0; - if (!plugin_start_fetch(p, data.redirect)) - plugin_destroy_stream(p, - plugin_STREAM_DESTROY_ERROR); - break; - case CONTENT_MSG_NEWPTR: p->c = c; break; @@ -1775,7 +1767,6 @@ void plugin_fetch_callback(fetch_msg msg, void *p, const void *data, break; case FETCH_TYPE: - case FETCH_REDIRECT: case FETCH_NOTMODIFIED: case FETCH_AUTH: #ifdef WITH_SSL -- cgit v1.2.3