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

tests/server/resolve.c: fix deprecation warning #1682

Closed
wants to merge 1 commit into from

Conversation

MarcelRaad
Copy link
Member

MSVC warns that gethostbyname is deprecated. Always use getaddrinfo
instead to fix this when IPv6 is enabled, also for IPv4 resolves. This
is also consistent with what libcurl does.

I get the same test results on Ubuntu as before this change.

Required to change the MSVC warning level from 3 to 4 in the CMake build as proposed by @bagder in #1667 (comment).

MSVC warns that gethostbyname is deprecated. Always use getaddrinfo
instead to fix this when IPv6 is enabled, also for IPv4 resolves. This
is also consistent with what libcurl does.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.007%) to 75.317% when pulling 0d357b2 on MarcelRaad:resolve_gethostbyname into 798ad5d on curl:master.

he = gethostbyname(host);

rc = !he;
#endif
Copy link
Member

Choose a reason for hiding this comment

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

when you tested was ipv6 disabled? it looks like you're missing a brace here, otherwise it looks fine.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops, thanks! It was enabled, It thought that was the more interesting case.

@MarcelRaad MarcelRaad deleted the resolve_gethostbyname branch July 18, 2017 16:26
@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants