Skip to content
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

Replace deprecated CURLINFO_CONTENT_LENGTH_DOWNLOAD #8659

Merged
merged 2 commits into from
Jan 3, 2025

Conversation

remkos
Copy link
Contributor

@remkos remkos commented Jan 3, 2025

Description of proposed changes

Compiling on MacOS gave this warning:

src/gmt_remote.c:680:41: warning: 'CURLINFO_CONTENT_LENGTH_DOWNLOAD' is deprecated: since 7.55.0. Use CURLINFO_CONTENT_LENGTH_DOWNLOAD_T [-Wdeprecated-declarations]
  680 |                         res = curl_easy_getinfo (curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &filesize);
      |                                                        ^

So I have replaced CURLINFO_CONTENT_LENGTH_DOWNLOAD by CURLINFO_CONTENT_LENGTH_DOWNLOAD_T and changed the type of filesize from double to curl_off_t.

The addresses #8653

Reminders

  • Make sure that your code follows our style. Use the other functions/files as a basis.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Describe changes to function behavior and arguments in a comment below the function declaration.
  • If adding new functionality, add a detailed description to the documentation and/or an example.

@remkos remkos requested review from joa-quim and seisman January 3, 2025 13:49
@seisman
Copy link
Member

seisman commented Jan 3, 2025

Yes, it's deprecated since curl 7.55 (https://curl.se/libcurl/c/CURLINFO_CONTENT_LENGTH_DOWNLOAD.html), and curl 7.55 was released in 2017 (https://curl.se/docs/releases.html), so I think it should be good.

Maybe we should also set the minimum required curl version in the following line

find_package (CURL REQUIRED)

@remkos
Copy link
Contributor Author

remkos commented Jan 3, 2025

Yes, that minimum curl version would be 7.55.0 then. I'll work out how to do that and add to the PR.

@remkos
Copy link
Contributor Author

remkos commented Jan 3, 2025

@seisman: Done as requested

@remkos remkos mentioned this pull request Jan 3, 2025
51 tasks
@remkos remkos force-pushed the curl_deprecation_fix branch from ff08555 to c89157d Compare January 3, 2025 14:36
@seisman seisman added this to the 6.6.0 milestone Jan 3, 2025
@seisman seisman added the maintenance Boring but important stuff for the core devs label Jan 3, 2025
Copy link
Member

@seisman seisman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@seisman
Copy link
Member

seisman commented Jan 3, 2025

@remkos Next time, you can just ping @GenericMappingTools/gmt-maintainers for code reviews.

This team contains people who maintain/change the codes. See https://github.com/orgs/GenericMappingTools/teams/gmt-maintainers for the list of people.

On the other hand, if you want to be pinged for PR reviews, I can also add you to the team.

@remkos
Copy link
Contributor Author

remkos commented Jan 3, 2025

Thanks for the suggestions, @seisman. I have already added myself to @GenericMappingTools/gmt-contributors and will use that in future review requests.

@joa-quim
Copy link
Member

joa-quim commented Jan 3, 2025

We should have only one group for asking reviews. The way we have it it's too confusing what-is-what-and-what-for.

@remkos remkos merged commit 7aed048 into master Jan 3, 2025
15 of 18 checks passed
@remkos remkos deleted the curl_deprecation_fix branch January 3, 2025 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Boring but important stuff for the core devs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants