summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2008-01-28 01:35:00 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2008-01-28 01:35:00 +0000
commit78d194cb77db00a530779aa2a1e8d2ef9707d229 (patch)
treeba4d25c396623825fcc020bf26cd757ca34f37ec /desktop
parent32fe1bd1bfcaa2c96cd407c3d1e20f2d4000bd0b (diff)
downloadnetsurf-78d194cb77db00a530779aa2a1e8d2ef9707d229.tar.gz
netsurf-78d194cb77db00a530779aa2a1e8d2ef9707d229.tar.bz2
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
Diffstat (limited to 'desktop')
-rw-r--r--desktop/browser.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/desktop/browser.c b/desktop/browser.c
index 01e91846f..1f2709ec8 100644
--- a/desktop/browser.c
+++ b/desktop/browser.c
@@ -509,23 +509,6 @@ void browser_window_callback(content_msg msg, struct content *c,
browser_window_set_status(bw, c->status_message);
break;
- case CONTENT_MSG_REDIRECT:
- {
- const char *prev_url = bw->loading_content->url;
-
- bw->loading_content = 0;
- browser_window_set_status(bw,
- messages_get("Redirecting"));
- /* the spec says nothing about referrers and
- * redirects => follow Mozilla and preserve the
- * referer across the redirect */
- browser_window_go_post(bw, data.redirect, 0, 0,
- bw->history_add, bw->referer,
- bw->download, false,
- bw->referer ? bw->referer : prev_url);
- }
- break;
-
case CONTENT_MSG_REFORMAT:
if (c == bw->current_content &&
c->type == CONTENT_HTML) {
@@ -1177,7 +1160,6 @@ void download_window_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