From ac0fdf2953b31398ecb07410c174cefe64a4bfd5 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Wed, 26 Jul 2023 20:28:55 +0200 Subject: [PATCH 1/2] Fix unused parameter Should be used as the write function pointer, this was overseen in commit '31d92b43'. --- r5dev/tier2/curlutils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r5dev/tier2/curlutils.cpp b/r5dev/tier2/curlutils.cpp index fa99d13c..c5cefd08 100644 --- a/r5dev/tier2/curlutils.cpp +++ b/r5dev/tier2/curlutils.cpp @@ -42,7 +42,7 @@ CURL* CURLInitRequest(const char* remote, const char* request, string& outRespon curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeOut); curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_ALL); - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, CURLWriteStringCallback); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writeFunction); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &outResponse); curl_easy_setopt(curl, CURLOPT_VERBOSE, debug); From 7ea51dda8a9a0ea961d2f80154709dc6c3b621cb Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Wed, 26 Jul 2023 20:34:02 +0200 Subject: [PATCH 2/2] Set an user agent Some end points require it. --- r5dev/tier2/curlutils.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/r5dev/tier2/curlutils.cpp b/r5dev/tier2/curlutils.cpp index c5cefd08..943e1f62 100644 --- a/r5dev/tier2/curlutils.cpp +++ b/r5dev/tier2/curlutils.cpp @@ -40,6 +40,7 @@ CURL* CURLInitRequest(const char* remote, const char* request, string& outRespon curl_easy_setopt(curl, CURLOPT_POSTFIELDS, request); curl_easy_setopt(curl, CURLOPT_POST, 1L); curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeOut); + curl_easy_setopt(curl, CURLOPT_USERAGENT, "R5R HTTPS/1.0"); curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_ALL); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writeFunction);