[前][次][番号順一覧][スレッド一覧]

ruby-changes:62732

From: Masaki <ko1@a...>
Date: Fri, 28 Aug 2020 01:03:42 +0900 (JST)
Subject: [ruby-changes:62732] 9658a5a849 (master): Show deprecation warning on TCPSocket.gethostbyname

https://git.ruby-lang.org/ruby.git/commit/?id=9658a5a849

From 9658a5a849d58c206074557e4f716ec0dffdfe59 Mon Sep 17 00:00:00 2001
From: Masaki Matsushita <glass.saga@g...>
Date: Thu, 27 Aug 2020 23:49:05 +0900
Subject: Show deprecation warning on TCPSocket.gethostbyname


diff --git a/ext/socket/tcpsocket.c b/ext/socket/tcpsocket.c
index 29a3eda..f3fcee7 100644
--- a/ext/socket/tcpsocket.c
+++ b/ext/socket/tcpsocket.c
@@ -59,6 +59,7 @@ tcp_sockaddr(struct sockaddr *addr, socklen_t len) https://github.com/ruby/ruby/blob/trunk/ext/socket/tcpsocket.c#L59
 static VALUE
 tcp_s_gethostbyname(VALUE obj, VALUE host)
 {
+    rb_warn("TCPSocket.gethostbyname is deprecated; use Addrinfo.getaddrinfo instead.");
     struct rb_addrinfo *res =
 	rsock_addrinfo(host, Qnil, AF_UNSPEC, SOCK_STREAM, AI_CANONNAME);
     return rsock_make_hostent(host, res, tcp_sockaddr);
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]