mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
aa92750f27
* re.c (rb_reg_eqq): document fix. [ruby-talk:122541] * io.c (io_fread): take VALUE argument. * ext/socket/socket.c (sock_connect): use rb_str_new4(). [ruby-dev:25052] * eval.c (rb_yield_0): [ruby-dev:25051] * io.c (io_write): remove rb_str_locktmp(). [ruby-dev:25050] * io.c (io_fwrite): takes VALUE string as an argument. [ruby-dev:25050] * ext/socket/socket.c (sock_connect): remove rb_str_locktmp(). [ruby-dev:25050] * ext/socket/socket.c (udp_connect): [ruby-dev:25045] * ext/socket/socket.c (udp_bind): ditto. * ext/socket/socket.c (udp_send): ditto. * ext/socket/socket.c (bsock_send): ditto. * ext/socket/socket.c (s_recvfrom): ditto. * hash.c (rb_hash_hash): should provide "hash" method where "eql?" is redefined. [ruby-talk:122482] * ext/socket/socket.c (bsock_setsockopt): [ruby-dev:25039] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
27 lines
598 B
Ruby
27 lines
598 B
Ruby
begin
|
|
require "socket"
|
|
require "test/unit"
|
|
rescue LoadError
|
|
end
|
|
|
|
|
|
class TestTCPSocket < Test::Unit::TestCase
|
|
def test_recvfrom # [ruby-dev:24705]
|
|
svr = TCPServer.new("localhost", 0)
|
|
Thread.new {
|
|
s = svr.accept
|
|
s.print("x"*0x1000)
|
|
}
|
|
addr = svr.addr
|
|
s = TCPSocket.open(addr[2], addr[1])
|
|
Thread.new {
|
|
Thread.pass
|
|
ObjectSpace.each_object(String) {|s|
|
|
s.replace "a" if s.length == 0x10000
|
|
}
|
|
}
|
|
assert_raise(RuntimeError) {
|
|
open("/tmp/n", "w"){|f| f.puts(data = s.recvfrom(0x10000))}
|
|
}
|
|
end
|
|
end if defined?(TCPSocket)
|