Show deprecation warning on TCPSocket.gethostbyname
This commit is contained in:
parent
5483bf8fa4
commit
9658a5a849
@ -59,6 +59,7 @@ tcp_sockaddr(struct sockaddr *addr, socklen_t len)
|
|||||||
static VALUE
|
static VALUE
|
||||||
tcp_s_gethostbyname(VALUE obj, VALUE host)
|
tcp_s_gethostbyname(VALUE obj, VALUE host)
|
||||||
{
|
{
|
||||||
|
rb_warn("TCPSocket.gethostbyname is deprecated; use Addrinfo.getaddrinfo instead.");
|
||||||
struct rb_addrinfo *res =
|
struct rb_addrinfo *res =
|
||||||
rsock_addrinfo(host, Qnil, AF_UNSPEC, SOCK_STREAM, AI_CANONNAME);
|
rsock_addrinfo(host, Qnil, AF_UNSPEC, SOCK_STREAM, AI_CANONNAME);
|
||||||
return rsock_make_hostent(host, res, tcp_sockaddr);
|
return rsock_make_hostent(host, res, tcp_sockaddr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user