summaryrefslogtreecommitdiff
path: root/request.c
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-01-25 21:16:56 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-01-25 21:16:56 +0800
commit0e8e63c8199417d9c920e1a6b9a2a90ef4e595de (patch)
treec66419605cbfaa0a54ef71dea7049b4f755202c9 /request.c
parent39390f76cb75cfd5830495301cb08221e7934d5b (diff)
Writes/reads to/from a cookie file
Diffstat (limited to 'request.c')
-rw-r--r--request.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/request.c b/request.c
index c969eeb..eedb597 100644
--- a/request.c
+++ b/request.c
@@ -18,6 +18,7 @@ extern emscripten_fetch_attr_t attr;
extern char *sampleurl;
extern char *cainfo;
+extern char *cookiefile;
struct container {
struct curl_httppost *post;
@@ -148,7 +149,8 @@ void request(void (*handler)(interchange_response *), void (*callback)(void *),
#else
CURL *curl = curl_easy_init();
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
- curl_easy_setopt(curl, CURLOPT_COOKIEFILE, "");
+ curl_easy_setopt(curl, CURLOPT_COOKIEJAR, cookiefile);
+ curl_easy_setopt(curl, CURLOPT_COOKIEFILE, cookiefile);
if (cainfo)
curl_easy_setopt(curl, CURLOPT_CAINFO, cainfo);
#ifdef DEBUG