diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2008-02-03 12:04:48 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2008-02-03 12:04:48 +0000 |
commit | ad6fcea6b008638ca532436ecf8ba9fe7e41ffdd (patch) | |
tree | 7928f5211a6cd644dcfd764b1c67cf3f6b8ed121 /content/fetchcache.c | |
parent | eb2c2e3f63056e7f8b992f17f94a9418ac311a0f (diff) | |
download | netsurf-ad6fcea6b008638ca532436ecf8ba9fe7e41ffdd.tar.gz netsurf-ad6fcea6b008638ca532436ecf8ba9fe7e41ffdd.tar.bz2 |
Add url_fragment to extract fragment from URL
Optionally allow url_compare to ignore fragments in comparison
Fix handling of url_compare result in a few places
Fix redirects which contain fragments in the Location header
svn path=/trunk/netsurf/; revision=3826
Diffstat (limited to 'content/fetchcache.c')
-rw-r--r-- | content/fetchcache.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/content/fetchcache.c b/content/fetchcache.c index b6b17a618..4fdbb93ca 100644 --- a/content/fetchcache.c +++ b/content/fetchcache.c @@ -689,6 +689,8 @@ void fetchcache_notmodified(struct content *c, const void *data) } content_remove_user(c, callback, p1, p2); + + msg_data.new_url = NULL; callback(CONTENT_MSG_NEWPTR, fb, p1, p2, msg_data); /* and catch user up with fallback's state */ @@ -786,25 +788,26 @@ void fetchcache_redirect(struct content *c, const void *data, { char *url, *url1; char *referer, *parent_url; - long http_code = fetch_http_code(c->fetch); - const char *ref = fetch_get_referer(c->fetch); - const char *parent = fetch_get_parent_url(c->fetch); + long http_code; + const char *ref; + const char *parent; union content_msg_data msg_data; url_func_result result; /* Preconditions */ assert(c && data); assert(c->status == CONTENT_STATUS_TYPE_UNKNOWN); - /* Ensure a redirect happened */ - assert(300 <= http_code && http_code <= 399); - /* 304 is handled by fetch_notmodified() */ - assert(http_code != 304); /* Extract fetch details */ http_code = fetch_http_code(c->fetch); ref = fetch_get_referer(c->fetch); parent = fetch_get_parent_url(c->fetch); + /* Ensure a redirect happened */ + assert(300 <= http_code && http_code <= 399); + /* 304 is handled by fetch_notmodified() */ + assert(http_code != 304); + /* Clone referer and parent url * originals are destroyed in fetch_abort() */ referer = ref ? strdup(ref) : NULL; @@ -941,6 +944,7 @@ void fetchcache_redirect(struct content *c, const void *data, replacement->redirect_count = c->redirect_count + 1; /* Notify user that content has changed */ + msg_data.new_url = url; callback(CONTENT_MSG_NEWPTR, replacement, p1, p2, msg_data); /* Start fetching the replacement content */ |