ruby-changes:9765
From: yugui <ko1@a...>
Date: Sun, 4 Jan 2009 15:16:20 +0900 (JST)
Subject: [ruby-changes:9765] Ruby:r21307 (ruby_1_9_1): merges r21278 from trunk into ruby_1_9_1.
yugui 2009-01-04 15:15:58 +0900 (Sun, 04 Jan 2009) New Revision: 21307 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=21307 Log: merges r21278 from trunk into ruby_1_9_1. * ext/socket/socket.c: don't apply socktype hack [ruby-core:184] for sock_s_getaddrinfo. (sock_getaddrinfo): add socktype_hack argument. (sock_addrinfo): call sock_getaddrinfo with socktype_hack. (sock_s_getaddrinfo): call sock_getaddrinfo without socktype_hack. [ruby-dev:37674] Modified files: branches/ruby_1_9_1/ChangeLog branches/ruby_1_9_1/ext/socket/socket.c Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 21306) +++ ruby_1_9_1/ChangeLog (revision 21307) @@ -1,3 +1,12 @@ +Fri Jan 2 23:36:10 2009 Tanaka Akira <akr@f...> + + * ext/socket/socket.c: don't apply socktype hack [ruby-core:184] for + sock_s_getaddrinfo. + (sock_getaddrinfo): add socktype_hack argument. + (sock_addrinfo): call sock_getaddrinfo with socktype_hack. + (sock_s_getaddrinfo): call sock_getaddrinfo without socktype_hack. + [ruby-dev:37674] + Fri Jan 2 23:33:38 2009 NAKAMURA Usaku <usa@r...> * include/ruby/missing.h, sprintf.c: get rid of a warning of VC++. Index: ruby_1_9_1/ext/socket/socket.c =================================================================== --- ruby_1_9_1/ext/socket/socket.c (revision 21306) +++ ruby_1_9_1/ext/socket/socket.c (revision 21307) @@ -926,7 +926,7 @@ #endif static struct addrinfo* -sock_getaddrinfo(VALUE host, VALUE port, struct addrinfo *hints) +sock_getaddrinfo(VALUE host, VALUE port, struct addrinfo *hints, int socktype_hack) { struct addrinfo* res = NULL; char *hostp, *portp; @@ -936,7 +936,7 @@ hostp = host_str(host, hbuf, sizeof(hbuf)); portp = port_str(port, pbuf, sizeof(pbuf)); - if (hints->ai_socktype == 0 && hints->ai_flags == 0 && str_isnumber(portp)) { + if (socktype_hack && hints->ai_socktype == 0 && hints->ai_flags == 0 && str_isnumber(portp)) { hints->ai_socktype = SOCK_DGRAM; } @@ -978,7 +978,7 @@ hints.ai_family = AF_UNSPEC; hints.ai_socktype = socktype; hints.ai_flags = flags; - return sock_getaddrinfo(host, port, &hints); + return sock_getaddrinfo(host, port, &hints, 1); } static VALUE @@ -3315,7 +3315,7 @@ if (!NIL_P(flags)) { hints.ai_flags = NUM2INT(flags); } - res = sock_getaddrinfo(host, port, &hints); + res = sock_getaddrinfo(host, port, &hints, 0); ret = make_addrinfo(res); freeaddrinfo(res); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/