mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/socket/socket.c (s_recv, s_recvfrom): some systems (such as
windows) doesn't set fromlen if the socket is connection-oriented. reported by Bram Whillock in [ruby-core:10512] [ruby-Bugs#9061] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9a41f064fa
commit
eed46ac633
2 changed files with 8 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Tue Apr 3 15:50:41 2007 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* ext/socket/socket.c (s_recv, s_recvfrom): some systems (such as
|
||||||
|
windows) doesn't set fromlen if the socket is connection-oriented.
|
||||||
|
reported by Bram Whillock in [ruby-core:10512] [ruby-Bugs#9061]
|
||||||
|
|
||||||
Tue Apr 3 09:36:55 2007 NAKAMURA Usaku <usa@ruby-lang.org>
|
Tue Apr 3 09:36:55 2007 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* ext/openssl/ruby_missing.h: need to include version.h to check
|
* ext/openssl/ruby_missing.h: need to include version.h to check
|
||||||
|
|
|
@ -621,7 +621,7 @@ s_recvfrom(VALUE sock, int argc, VALUE *argv, enum sock_recv_type 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 */
|
if (alen && alen != sizeof(buf)) /* 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
|
else
|
||||||
return rb_assoc_new(str, Qnil);
|
return rb_assoc_new(str, Qnil);
|
||||||
|
@ -686,7 +686,7 @@ s_recvfrom_nonblock(VALUE sock, int argc, VALUE *argv, enum sock_recv_type from)
|
||||||
return str;
|
return str;
|
||||||
|
|
||||||
case RECV_IP:
|
case RECV_IP:
|
||||||
if (alen) /* connection-oriented socket may not return a from result */
|
if (alen && alen != sizeof(buf)) /* connection-oriented socket may not return a from result */
|
||||||
addr = ipaddr((struct sockaddr*)buf, fptr->mode & FMODE_NOREVLOOKUP);
|
addr = ipaddr((struct sockaddr*)buf, fptr->mode & FMODE_NOREVLOOKUP);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue