Skip to content

Commit

Permalink
fix: CURLINFO_RESPONSE_CODE datatype
Browse files Browse the repository at this point in the history
We should be using `long` instead of `int`:
https://curl.se/libcurl/c/CURLINFO_RESPONSE_CODE.html

Error message when compiling:

src/worker.c: In function ‘worker_main’:
src/worker.c:355:57: error: call to ‘_curl_easy_getinfo_err_long’ declared with attribute warning: curl_easy_getinfo expects a pointer to long for this info [-Werror=attribute-warning]
  355 |                                                         curl_easy_getinfo(eh, CURLINFO_RESPONSE_CODE, &http_status_code);
      |                                                         ^
  • Loading branch information
soedirgo authored and steve-chavez committed May 6, 2024
1 parent f03664b commit 006d49e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ worker_main(Datum main_arg)
} else {
CurlData *cdata = NULL;
char *contentType = NULL;
int http_status_code;
long http_status_code;

curl_easy_getinfo(eh, CURLINFO_RESPONSE_CODE, &http_status_code);
curl_easy_getinfo(eh, CURLINFO_CONTENT_TYPE, &contentType);
Expand Down

0 comments on commit 006d49e

Please sign in to comment.