From 4e17e2ddd554a73fa46824188eaba55e53e6d51c Mon Sep 17 00:00:00 2001 From: 9pfs <9pfs@amcforum.wiki> Date: Wed, 24 Apr 2024 01:00:23 +0000 Subject: [PATCH] Don't URL encode payloads anymore --- notify.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/notify.c b/notify.c index 052a2c7..5b9e8d4 100644 --- a/notify.c +++ b/notify.c @@ -5,6 +5,8 @@ #include #include #define NOTIFICATION_PREFIX "[h/nest-sanity-checks] " +/* No longer URL encoding payloads. TODO: remove later */ +#pragma GCC poison urlencoded_report /* #define NOTIFICATION_PREFIX_LEN sizeof(NOTIFICATION_PREFIX) */ /* notify_init() initializes curl. If this fails, exiting is the only option, as curl must be usable, @@ -71,17 +73,10 @@ int send_alarm(const char *report) { const char *prefixed_report; prefixed_report = build_prefixed_report(report); assert(prefixed_report!=NULL); - const char *urlencoded_report; - urlencoded_report = curl_easy_escape(curl, prefixed_report, 0); - /* assert(urlencoded_report!=NULL); */ - if(urlencoded_report == NULL) { - fprintf(stderr, "[E] Failed to send report, curl_easy_escape failed.\n"); - return -1; - } CURLcode post_field_set_result; - post_field_set_result = curl_easy_setopt(curl, CURLOPT_POSTFIELDS, urlencoded_report); + post_field_set_result = curl_easy_setopt(curl, CURLOPT_POSTFIELDS, prefixed_report); if(post_field_set_result != CURLE_OK) { - fprintf(stderr, "[E] Failed to send report, setting CURLOPT_POSTFIELDS to %s failed.\n", urlencoded_report); + fprintf(stderr, "[E] Failed to send report, setting CURLOPT_POSTFIELDS to %s failed.\n", prefixed_report); return -1; } CURLcode res;