JDK-8080990: libdt_socket/socket_md.c(202) : warning C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW()
gary.adams at oracle.com
gary.adams at oracle.com
Wed Feb 7 17:55:38 UTC 2018
On 2/7/18 12:31 PM, Chris Hegarty wrote:
> Gary,
>
>> http://cr.openjdk.java.net/%7Egadams/8080990/webrev.02/
> I think the replacement of WSASendDisconnect with
> shutdown(SD_SEND) should be fine. I do note that there
> is another usage of WSASendDisconnect in
> java.base/windows/native/libnet/net_util_md.c.
Thanks for the reference.
I'm not sure how that one slipped by unnoticed.
>
> [ Maybe you want to separate out the changes in java.base
> ( NIO and NET ) from the serviceability changes? Up to
> you. ]
Actually, this change is about removing the compilation flag globally
in flags.m4 and any sources that need to be updated
to replace the deprecated functions.
>
> Curious about the specific hints you have chosen to use.
> In other areas we have the following:
> hints.ai_flags = AI_CANONNAME;
> hints.ai_family = AF_INET;
>
> [ Not saying that what you have is incorrect, just questioning
> if you need to specify the socket type and protocol ]
One of the benefits of getaddrinfo is that it can return a list of
addresses from the name service. In the places we were using
gethostbyname we were looking for just one ipv4 address.
By adding additional constraints on the supplied hints, it can help
reduce the list of returned addresses.
>
> -Chris.
More information about the serviceability-dev
mailing list