concord
concord copied to clipboard
Fix cURL deprecated warning
Notice
- [x] I understand the code that I have edited, and have the means 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 with curl_multi_perform
, replacing curl_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.
Looks good, have you tested it?
according to https://curl.se/libcurl/c/curl_multi_socket_action.html
you should call
6. Call [curl_multi_socket_action](https://curl.se/libcurl/c/curl_multi_socket_action.html)(..., CURL_SOCKET_TIMEOUT, 0, ...) to kickstart everything. To get one or more callbacks called.
instead of 0, which is a legitimate file descriptor. I haven't tested this, and am too lazy to right now.
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