-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix cURL deprecated warning #171
Conversation
Looks good, have you tested it? |
src/discord-rest_request.c
Outdated
@@ -360,7 +360,7 @@ discord_requestor_info_read(struct discord_requestor *rqtor) | |||
{ | |||
int alive = 0; | |||
|
|||
if (CURLM_OK != curl_multi_socket_all(rqtor->mhandle, &alive)) | |||
if (CURLM_OK != curl_multi_socket_action(rqtor->mhandle, 0, 0, &alive)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to check what != CURLM_OK
means for curl_multi_socket_action()
. Does it actually translates to a CCORD_CURLM_INTERNAL
error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
according to https://curl.se/libcurl/c/curl_multi_socket_action.html |
This commit fixes a deprecated warning due to the usage of "curl_multi_socket_all" in libcurl versions.
f5fd637
to
1f2a958
Compare
Works perfectly with my tests. Thank you both |
I'll have to open another PR as even though this works, it weirdly consumes gigantic amounts of CPU |
Just an update: As this is weird, and seemingly there's no useful information out in the web, I created a discussion in curl repository |
Notice
to test it before making changes to Concord.
What?
This PR "replaces" (deprecated) curl_multi_socket_all with curl_multi_socket_action.
Why?
As mentioned before,
_all
is deprecated since 7.19.5. In other words, versions above or equal 7.19.5 should not use it, and should use_action
instead. Concord requires libcurl 7.56.1 minimum, which makes its usage not recommended.How?
This PR introduces the usage of
curl_multi_socket_action
(as per "recommended" by libcurl documentation) together withcurl_multi_perform
, replacingcurl_multi_socket_all
.Testing?
To test the minimum "workability" of this PR, a bot was compiled with this PR.
Anything Else?
Those changes are slightly experimental, as no explicit replacement is made in libcurl documentation, only for
curl_multi_socket
.I may also point out that even if this PR is not introduced, curl_multi_socket_all usage is not recommended.