mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/socket/ (rsock_make_hostent): renamed from sock_make_hostent.
(rsock_addrinfo): renamed from sock_addrinfo. (rsock_getaddrinfo): renamed from sock_getaddrinfo. (rsock_socket): renamed from ruby_socket. (rsock_sock_s_socketpair): renamed from sock_s_socketpair. (rsock_connect): renamed from ruby_connect. * ext/socket/socket.c (sock_listen): make it static. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a6274c1e72
commit
172d208789
9 changed files with 47 additions and 38 deletions
|
@ -46,19 +46,19 @@ init_inetsock_internal(struct inetsock_arg *arg)
|
|||
int fd, status = 0;
|
||||
const char *syscall = 0;
|
||||
|
||||
arg->remote.res = sock_addrinfo(arg->remote.host, arg->remote.serv, SOCK_STREAM,
|
||||
arg->remote.res = rsock_addrinfo(arg->remote.host, arg->remote.serv, SOCK_STREAM,
|
||||
(type == INET_SERVER) ? AI_PASSIVE : 0);
|
||||
/*
|
||||
* Maybe also accept a local address
|
||||
*/
|
||||
|
||||
if (type != INET_SERVER && (!NIL_P(arg->local.host) || !NIL_P(arg->local.serv))) {
|
||||
arg->local.res = sock_addrinfo(arg->local.host, arg->local.serv, SOCK_STREAM, 0);
|
||||
arg->local.res = rsock_addrinfo(arg->local.host, arg->local.serv, SOCK_STREAM, 0);
|
||||
}
|
||||
|
||||
arg->fd = fd = -1;
|
||||
for (res = arg->remote.res; res; res = res->ai_next) {
|
||||
status = ruby_socket(res->ai_family,res->ai_socktype,res->ai_protocol);
|
||||
status = rsock_socket(res->ai_family,res->ai_socktype,res->ai_protocol);
|
||||
syscall = "socket(2)";
|
||||
fd = status;
|
||||
if (fd < 0) {
|
||||
|
@ -81,8 +81,8 @@ init_inetsock_internal(struct inetsock_arg *arg)
|
|||
}
|
||||
|
||||
if (status >= 0) {
|
||||
status = ruby_connect(fd, res->ai_addr, res->ai_addrlen,
|
||||
(type == INET_SOCKS));
|
||||
status = rsock_connect(fd, res->ai_addr, res->ai_addrlen,
|
||||
(type == INET_SOCKS));
|
||||
syscall = "connect(2)";
|
||||
}
|
||||
}
|
||||
|
@ -223,7 +223,7 @@ static VALUE
|
|||
ip_s_getaddress(VALUE obj, VALUE host)
|
||||
{
|
||||
struct sockaddr_storage addr;
|
||||
struct addrinfo *res = sock_addrinfo(host, Qnil, SOCK_STREAM, 0);
|
||||
struct addrinfo *res = rsock_addrinfo(host, Qnil, SOCK_STREAM, 0);
|
||||
|
||||
/* just take the first one */
|
||||
memcpy(&addr, res->ai_addr, res->ai_addrlen);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue