зеркало из https://github.com/github/ruby.git
* ext/socket/socket.c (sock_s_getservbyport): port should be
network byte order. a patch from Dave Thomas in [ruby-core:19454]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
38c7a687e1
Коммит
c1bb485ca0
|
@ -1,3 +1,8 @@
|
|||
Thu Oct 23 08:06:03 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* ext/socket/socket.c (sock_s_getservbyport): port should be
|
||||
network byte order. a patch from Dave Thomas in [ruby-core:19454].
|
||||
|
||||
Thu Oct 23 01:26:25 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* string.c (rb_str_conv_enc_opts): new function to convert with
|
||||
|
|
|
@ -3254,7 +3254,7 @@ sock_s_getservbyport(int argc, VALUE *argv)
|
|||
if (NIL_P(proto)) proto = rb_str_new2("tcp");
|
||||
StringValue(proto);
|
||||
|
||||
sp = getservbyport(NUM2INT(port), StringValueCStr(proto));
|
||||
sp = getservbyport(htons(NUM2INT(port)), StringValueCStr(proto));
|
||||
if (!sp) {
|
||||
rb_raise(rb_eSocket, "no such service for port %d/%s", NUM2INT(port), RSTRING_PTR(proto));
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче