зеркало из https://github.com/github/ruby.git
* ext/socket/socket.c: don't use AI_NUMERICSERV for platforms which
not define it as old Windows. [ruby-dev:37736] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
20f7868106
Коммит
c9ef4fc52f
|
@ -1,3 +1,9 @@
|
|||
Thu Jan 8 22:44:10 2009 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* ext/socket/socket.c: don't use AI_NUMERICSERV for platforms which
|
||||
not define it as old Windows.
|
||||
[ruby-dev:37736]
|
||||
|
||||
Thu Jan 8 17:32:51 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* instruby.rb: should not depend on a library which does not exist
|
||||
|
|
|
@ -1145,7 +1145,9 @@ port_str(VALUE port, char *pbuf, size_t len, int *flags_ptr)
|
|||
}
|
||||
else if (FIXNUM_P(port)) {
|
||||
snprintf(pbuf, len, "%ld", FIX2LONG(port));
|
||||
#ifdef AI_NUMERICSERV
|
||||
if (flags_ptr) *flags_ptr |= AI_NUMERICSERV;
|
||||
#endif
|
||||
return pbuf;
|
||||
}
|
||||
else {
|
||||
|
@ -4020,15 +4022,20 @@ addrinfo_initialize(int argc, VALUE *argv, VALUE self)
|
|||
VALUE service = rb_ary_entry(sockaddr_ary, 1);
|
||||
VALUE nodename = rb_ary_entry(sockaddr_ary, 2);
|
||||
VALUE numericnode = rb_ary_entry(sockaddr_ary, 3);
|
||||
int flags;
|
||||
|
||||
service = INT2NUM(NUM2INT(service));
|
||||
if (!NIL_P(nodename))
|
||||
StringValue(nodename);
|
||||
StringValue(numericnode);
|
||||
flags = AI_NUMERICHOST;
|
||||
#ifdef AI_NUMERICSERV
|
||||
flags |= AI_NUMERICSERV;
|
||||
#endif
|
||||
|
||||
init_addrinfo_getaddrinfo(rai, numericnode, service,
|
||||
INT2NUM(i_pfamily ? i_pfamily : af), INT2NUM(i_socktype), INT2NUM(i_protocol),
|
||||
INT2NUM(AI_NUMERICHOST|AI_NUMERICSERV),
|
||||
INT2NUM(flags),
|
||||
rb_str_equal(numericnode, nodename) ? Qnil : make_inspectname(nodename, service));
|
||||
break;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче