зеркало из https://github.com/github/ruby.git
Work around OSX strangneness with recvfrom on connection-oriented sockets
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
3e1c383e45
Коммит
ac0ba927f3
|
@ -1,3 +1,9 @@
|
|||
Wed Jun 23 22:19:10 2004 Dave Thomas <dave@pragprog.com>
|
||||
|
||||
* ext/socket/socket.c (sock_s_gethostbyaddr): Work around problem
|
||||
with OS X not returning 'from' parameter to recvfrom for
|
||||
connection-oriented sockets.
|
||||
|
||||
Wed Jun 23 22:16:16 2004 Michal Rokos <michal@ruby-lang.org>
|
||||
|
||||
* io.c: io_seek()'s retval should be checked [ruby-core:03045]
|
||||
|
|
|
@ -492,7 +492,11 @@ s_recvfrom(sock, argc, argv, from)
|
|||
rb_raise(rb_eTypeError, "sockaddr size differs - should not happen");
|
||||
}
|
||||
#endif
|
||||
return rb_assoc_new(str, ipaddr((struct sockaddr*)buf, fptr->mode & FMODE_NOREVLOOKUP));
|
||||
if (alen) /* OSX doesn't return a from result for connection-oriented sockets */
|
||||
return rb_assoc_new(str, ipaddr((struct sockaddr*)buf, fptr->mode & FMODE_NOREVLOOKUP));
|
||||
else
|
||||
return rb_assoc_new(str, Qnil);
|
||||
|
||||
#ifdef HAVE_SYS_UN_H
|
||||
case RECV_UNIX:
|
||||
return rb_assoc_new(str, unixaddr((struct sockaddr_un*)buf));
|
||||
|
|
Загрузка…
Ссылка в новой задаче