From 0e8e63c8199417d9c920e1a6b9a2a90ef4e595de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Wed, 25 Jan 2023 21:16:56 +0800 Subject: Writes/reads to/from a cookie file --- request.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'request.c') 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 -- cgit v1.2.3