1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

test/socket/test_basicsocket.rb (socks): bind explicitly to localhost

Binding to a potentially public IP in a test can cause problems
if hit by a random port scanner or something...

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
normal 2017-05-15 07:33:10 +00:00
parent 0f4d856d4d
commit fba0b81e18

View file

@ -98,7 +98,7 @@ class TestSocket_BasicSocket < Test::Unit::TestCase
end
def socks
sserv = TCPServer.new(0)
sserv = TCPServer.new('localhost', 0)
ssock = nil
t = Thread.new { ssock = sserv.accept }
csock = TCPSocket.new('localhost', sserv.addr[1])