concord icon indicating copy to clipboard operation
concord copied to clipboard

Fix cURL deprecated warning

Open ThePedroo opened this issue 1 year ago • 3 comments

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.

ThePedroo avatar Feb 01 '24 07:02 ThePedroo

Looks good, have you tested it?

lcsmuller avatar Feb 01 '24 13:02 lcsmuller

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.

Anotra avatar Feb 02 '24 22:02 Anotra

Works perfectly with my tests. Thank you both

ThePedroo avatar Feb 02 '24 23:02 ThePedroo

I'll have to open another PR as even though this works, it weirdly consumes gigantic amounts of CPU

ThePedroo avatar Mar 24 '24 14:03 ThePedroo

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

ThePedroo avatar Mar 31 '24 01:03 ThePedroo