tests/server/resolve.c: fix deprecation warning#1682
Closed
MarcelRaad wants to merge 1 commit into
Closed
Conversation
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.
jay
reviewed
Jul 18, 2017
| he = gethostbyname(host); | ||
|
|
||
| rc = !he; | ||
| #endif |
Member
There was a problem hiding this comment.
when you tested was ipv6 disabled? it looks like you're missing a brace here, otherwise it looks fine.
Member
Author
There was a problem hiding this comment.
Oops, thanks! It was enabled, It thought that was the more interesting case.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).