From 5d600bfd240a09df159b83460b81626f71ce5029 Mon Sep 17 00:00:00 2001 From: zedshaw Date: Mon, 3 Apr 2006 15:22:17 +0000 Subject: 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 --- examples/random_thrash.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 examples/random_thrash.rb (limited to 'examples') diff --git a/examples/random_thrash.rb b/examples/random_thrash.rb new file mode 100644 index 0000000..fe9311c --- /dev/null +++ b/examples/random_thrash.rb @@ -0,0 +1,19 @@ +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 -- cgit v1.2.3-24-ge0c7