diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2004-08-09 16:11:58 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2004-08-09 16:11:58 +0000 |
commit | c9bd6fa9fce386526ea1327adea56128648f3355 (patch) | |
tree | 419a7d4fcfd1a7ae7229763f0b9ed2125be0a02c /content | |
parent | 91e6c7c65bb496f88f6af622f558b35c436f9cd2 (diff) | |
download | netsurf-c9bd6fa9fce386526ea1327adea56128648f3355.tar.gz netsurf-c9bd6fa9fce386526ea1327adea56128648f3355.tar.bz2 |
[project @ 2004-08-09 16:11:58 by jmb]
Rework the interface of the URL handing module to allow for multiple error types.
Modify save_complete URL rewriting appropriately.
svn path=/import/netsurf/; revision=1206
Diffstat (limited to 'content')
-rw-r--r-- | content/fetch.c | 6 | ||||
-rw-r--r-- | content/fetchcache.c | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/content/fetch.c b/content/fetch.c index 81f5e3a26..cb1353f98 100644 --- a/content/fetch.c +++ b/content/fetch.c @@ -227,12 +227,16 @@ struct fetch * fetch_start(char *url, char *referer, CURLcode code; CURLMcode codem; struct curl_slist *slist; + url_func_result res; fetch = malloc(sizeof (*fetch)); if (!fetch) return 0; - host = url_host(url); + res = url_host(url, &host); + /* we only fail memory exhaustion */ + if (res == URL_FUNC_NOMEM) + goto failed; LOG(("fetch %p, url '%s'", fetch, url)); diff --git a/content/fetchcache.c b/content/fetchcache.c index e22a8ae5b..02ce109b1 100644 --- a/content/fetchcache.c +++ b/content/fetchcache.c @@ -206,6 +206,7 @@ void fetchcache_callback(fetch_msg msg, void *p, const char *data, char **params; unsigned int i; union content_msg_data msg_data; + url_func_result result; switch (msg) { case FETCH_TYPE: @@ -283,8 +284,8 @@ void fetchcache_callback(fetch_msg msg, void *p, const char *data, c->fetch = 0; /* redirect URLs must be absolute by HTTP/1.1, but many sites send * relative ones: treat them as relative to requested URL */ - url = url_join(data, c->url); - if (url) { + result = url_join(data, c->url, &url); + if (result == URL_FUNC_OK) { msg_data.redirect = url; content_broadcast(c, CONTENT_MSG_REDIRECT, msg_data); free(url); |