summaryrefslogtreecommitdiff
path: root/content/content.h
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 /content/content.h
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 'content/content.h')
-rw-r--r--content/content.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/content/content.h b/content/content.h
index 25202f33b..324af952f 100644
--- a/content/content.h
+++ b/content/content.h
@@ -82,7 +82,6 @@ typedef enum {
CONTENT_MSG_DONE, /**< finished */
CONTENT_MSG_ERROR, /**< error occurred */
CONTENT_MSG_STATUS, /**< new status string */
- CONTENT_MSG_REDIRECT, /**< replacement URL */
CONTENT_MSG_REFORMAT, /**< content_reformat done */
CONTENT_MSG_REDRAW, /**< needs redraw (eg. new animation frame) */
CONTENT_MSG_NEWPTR, /**< address of structure has changed */
@@ -227,6 +226,7 @@ struct content {
bool no_error_pages; /**< Used by fetchcache(). */
bool download; /**< Used by fetchcache(). */
+ unsigned int redirect_count; /**< Used by fetchcache(). */
/** Array of first n rendering errors or warnings. */
struct {