diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2003-10-25 19:20:13 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2003-10-25 19:20:13 +0000 |
commit | c9e188a4d1634d9c7d2292a8d04e02f313f37f3b (patch) | |
tree | a58742b163820d4ee839f4a035603afa50243e63 /content/fetch.c | |
parent | ed449261f62cb56a9d6eb7d16f7d54d79bbea1f4 (diff) | |
download | netsurf-c9e188a4d1634d9c7d2292a8d04e02f313f37f3b.tar.gz netsurf-c9e188a4d1634d9c7d2292a8d04e02f313f37f3b.tar.bz2 |
[project @ 2003-10-25 19:20:13 by jmb]
HTTP Auth login improved (greatly).
Addresses all three issues in the previous version.
svn path=/import/netsurf/; revision=382
Diffstat (limited to 'content/fetch.c')
-rw-r--r-- | content/fetch.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/content/fetch.c b/content/fetch.c index b7f48b506..391aa14d3 100644 --- a/content/fetch.c +++ b/content/fetch.c @@ -150,6 +150,7 @@ struct fetch * fetch_start(char *url, char *referer, CURLcode code; CURLMcode codem; xmlURI *uri; + struct login *li; LOG(("fetch %p, url '%s'", fetch, url)); @@ -268,12 +269,11 @@ struct fetch * fetch_start(char *url, char *referer, code = curl_easy_setopt(fetch->curl_handle, CURLOPT_HTTPAUTH, (long)CURLAUTH_BASIC); assert(code == CURLE_OK); -#ifdef riscos - if (LOGIN.string != NULL) { - code = curl_easy_setopt(fetch->curl_handle, CURLOPT_USERPWD, LOGIN.string); + if ((li=login_list_get(url)) != NULL) { + code = curl_easy_setopt(fetch->curl_handle, CURLOPT_USERPWD, li->logindetails); + assert(code == CURLE_OK); } -#endif /* POST */ if (fetch->post_urlenc) { @@ -545,16 +545,11 @@ bool fetch_process_headers(struct fetch *f) return true; } -#ifdef riscos /* handle HTTP 401 (Authentication errors) */ if (http_code == 401) { - /* this shouldn't be here... */ - ro_gui_401login_open(xstrdup(f->host), xstrdup(f->realm), - xstrdup(f->url)); - f->callback(FETCH_ERROR, f->p, "",0); + f->callback(FETCH_AUTH, f->p, xstrdup(f->realm),0); return true; } -#endif /* handle HTTP errors (non 2xx response codes) */ if (f->only_2xx && strncmp(f->url, "http", 4) == 0 && |