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
Thu Feb 1 11:16:49 UTC 2018


First pass over the code I disabled the compilation flag and then
did quick substitution for the easier functions. I commented out the
WSASendDisconnect calls so I could see what tests would fail if
the function was just removed. I have a replacement now that uses
"shutdown(fd,SD_SEND)", but I still have a few more test failures to
investigate.

I updated the error message text for "getaddrinfo".

I'll post a revised webrev after the 4 jshell errors are corrected.


On 2/1/18 3:11 AM, Langer, Christoph wrote:
> Hi Gary,
>
> I was having a look at your changes.
>
> I'm wondering what the reason is behind uncommenting WSASendDisconnect in Java_sun_nio_ch_SocketDispatcher_preClose0 of file SocketDispatcher.c? And in dbgsysSocketClose?
>
> In socketTransport.c, line:
>      331                 setLastError(0, "gethostbyname: unknown host");
> you should change the description text of the error to getaddrinfo instead of gethostbyname.
>
> Best regards
> Christoph
>
>
>
> -----Original Message-----
> From: build-dev [mailto:build-dev-bounces at openjdk.java.net] On Behalf Of Gary Adams
> Sent: Donnerstag, 25. Januar 2018 19:47
> To: OpenJDK Serviceability <serviceability-dev at openjdk.java.net>; OpenJDK Build <build-dev at openjdk.java.net>; OpenJDK Networking <net-dev at openjdk.java.net>
> Subject: RFR: JDK-8080990: libdt_socket/socket_md.c(202) : warning C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW()
>
> Here's a first pass attempt to remove the -D_WINSOCK_DEPRECATED_NO_WARNINGS
> build flag and update the winsock deprecated functions.
>
>     Issue: https://bugs.openjdk.java.net/browse/JDK-8080990
>     Webrev: http://cr.openjdk.java.net/~gadams/8080990/
>
> These are the initial deprecated functions updated:
>      gethostbyname -> getaddrinfo
>      inet_addr -> inet_pton
>      inet_ntoa -> inet_ntop
>
> I'm not sure how to replace the existing WSASendDisconnect calls.
> It's not clear that it actually provides a graceful disconnect.
>
>



More information about the build-dev mailing list