1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00
puma--puma/examples/random_thrash.rb
zedshaw 5d600bfd24 Minor tweaks to the handlers and http parser to deal with more bad input possibilities.
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@139 19e92222-5c0b-0410-8929-a290d50e31e9
2006-04-03 15:22:17 +00:00

19 lines
316 B
Ruby

require 'socket'
devrand = open("/dev/random","r")
loop do
s = TCPSocket.new(ARGV[0],ARGV[1])
s.write("GET / HTTP/1.1\r\n")
total = 0
begin
loop do
r = devrand.read(10)
n = s.write(r)
total += n
end
rescue Object
STDERR.puts "#$!: #{total}"
end
s.close
sleep 1
end