mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
clean up variable names in do_test
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@699 19e92222-5c0b-0410-8929-a290d50e31e9
This commit is contained in:
parent
b4c1679c34
commit
e73e5d1707
1 changed files with 11 additions and 11 deletions
|
@ -45,22 +45,22 @@ class WebServerTest < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def do_test(st, chunk, close_after=nil)
|
def do_test(string, chunk, close_after=nil)
|
||||||
s = TCPSocket.new("127.0.0.1", 9998);
|
socket = TCPSocket.new("127.0.0.1", 9998);
|
||||||
req = StringIO.new(st)
|
request = StringIO.new(string)
|
||||||
nout = 0
|
chunks_out = 0
|
||||||
|
|
||||||
while data = req.read(chunk)
|
while data = request.read(chunk)
|
||||||
nout += s.write(data)
|
chunks_out += socket.write(data)
|
||||||
s.flush
|
socket.flush
|
||||||
sleep 0.2
|
sleep 0.2
|
||||||
if close_after and nout > close_after
|
if close_after and chunks_out > close_after
|
||||||
s.close_write
|
socket.close_write
|
||||||
sleep 1
|
sleep 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
s.write(" ") if RUBY_PLATFORM =~ /mingw|mswin|cygwin|java/
|
socket.write(" ") if RUBY_PLATFORM =~ /mingw|mswin|cygwin|java/
|
||||||
s.close
|
socket.close
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_trickle_attack
|
def test_trickle_attack
|
||||||
|
|
Loading…
Add table
Reference in a new issue