diff options
author | James Bursa <james@netsurf-browser.org> | 2003-12-26 16:20:57 +0000 |
---|---|---|
committer | James Bursa <james@netsurf-browser.org> | 2003-12-26 16:20:57 +0000 |
commit | 894703b53b27a25d58d9a6fa77e99d967e9588f6 (patch) | |
tree | 73a157f9dead6fe9bac8421f63e9b26066c999fd /content/fetch.c | |
parent | eb7cc625e71a9e761b22bd6fb94d93fbb929304e (diff) | |
download | netsurf-894703b53b27a25d58d9a6fa77e99d967e9588f6.tar.gz netsurf-894703b53b27a25d58d9a6fa77e99d967e9588f6.tar.bz2 |
[project @ 2003-12-26 16:20:57 by bursa]
Enable cookies.
svn path=/import/netsurf/; revision=443
Diffstat (limited to 'content/fetch.c')
-rw-r--r-- | content/fetch.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/content/fetch.c b/content/fetch.c index f7197a7aa..3140581d8 100644 --- a/content/fetch.c +++ b/content/fetch.c @@ -151,7 +151,7 @@ void fetch_quit(void) struct fetch * fetch_start(char *url, char *referer, void (*callback)(fetch_msg msg, void *p, char *data, unsigned long size), void *p, bool only_2xx, char *post_urlenc, - struct form_successful_control *post_multipart) + struct form_successful_control *post_multipart, bool cookies) { struct fetch *fetch = xcalloc(1, sizeof(*fetch)), *host_fetch; CURLcode code; @@ -298,6 +298,16 @@ struct fetch * fetch_start(char *url, char *referer, assert(code == CURLE_OK); } + /* Cookies */ + if (cookies) { + code = curl_easy_setopt(fetch->curl_handle, CURLOPT_COOKIEFILE, + messages_get("cookiefile")); + assert(code == CURLE_OK); + code = curl_easy_setopt(fetch->curl_handle, CURLOPT_COOKIEJAR, + messages_get("cookiejar")); + assert(code == CURLE_OK); + } + /* add to the global curl multi handle */ codem = curl_multi_add_handle(curl_multi, fetch->curl_handle); assert(codem == CURLM_OK || codem == CURLM_CALL_MULTI_PERFORM); |