mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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:
parent
3e1c383e45
commit
ac0ba927f3
2 changed files with 11 additions and 1 deletions
|
@ -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>
|
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]
|
* 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");
|
rb_raise(rb_eTypeError, "sockaddr size differs - should not happen");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
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));
|
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
|
#ifdef HAVE_SYS_UN_H
|
||||||
case RECV_UNIX:
|
case RECV_UNIX:
|
||||||
return rb_assoc_new(str, unixaddr((struct sockaddr_un*)buf));
|
return rb_assoc_new(str, unixaddr((struct sockaddr_un*)buf));
|
||||||
|
|
Loading…
Add table
Reference in a new issue