From ab8edd9da4ec6766dfb07acd25bea5c3f503c1e3 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sat, 25 Oct 2003 22:51:45 +0000 Subject: [project @ 2003-10-25 22:51:45 by jmb] Fix bug relating to http://www.mw-software.com/software/artworks2/aw2support.html svn path=/import/netsurf/; revision=388 --- content/fetch.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'content') diff --git a/content/fetch.c b/content/fetch.c index a6ff946f2..85e6f00f2 100644 --- a/content/fetch.c +++ b/content/fetch.c @@ -266,10 +266,10 @@ struct fetch * fetch_start(char *url, char *referer, } /* HTTP auth */ - code = curl_easy_setopt(fetch->curl_handle, CURLOPT_HTTPAUTH, (long)CURLAUTH_ANY); - assert(code == CURLE_OK); - if ((li=login_list_get(url)) != NULL) { + code = curl_easy_setopt(fetch->curl_handle, CURLOPT_HTTPAUTH, (long)CURLAUTH_ANY); + assert(code == CURLE_OK); + code = curl_easy_setopt(fetch->curl_handle, CURLOPT_USERPWD, li->logindetails); assert(code == CURLE_OK); @@ -301,6 +301,7 @@ struct fetch * fetch_start(char *url, char *referer, void fetch_abort(struct fetch *f) { CURLMcode codem; + struct login *li; assert(f != 0); LOG(("fetch %p, url '%s'", f, f->url)); @@ -356,6 +357,16 @@ void fetch_abort(struct fetch *f) assert(code == CURLE_OK); } + /* HTTP auth */ + if ((li=login_list_get(f->url)) != NULL) { + code = curl_easy_setopt(fetch->curl_handle, CURLOPT_HTTPAUTH, (long)CURLAUTH_ANY); + assert(code == CURLE_OK); + + code = curl_easy_setopt(fetch->curl_handle, CURLOPT_USERPWD, li->logindetails); + + assert(code == CURLE_OK); + } + /* POST */ if (fetch->post_urlenc) { code = curl_easy_setopt(fetch->curl_handle, -- cgit v1.2.3