From c6eaee2caa2318a009e91372afec6704c290fd22 Mon Sep 17 00:00:00 2001 From: zedshaw Date: Sun, 14 May 2006 23:42:19 +0000 Subject: IO processing loop now processes HTTP requests without resetting the parser making things more efficient. git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@180 19e92222-5c0b-0410-8929-a290d50e31e9 --- test/test_http11.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'test') diff --git a/test/test_http11.rb b/test/test_http11.rb index e100d2b..74c072d 100644 --- a/test/test_http11.rb +++ b/test/test_http11.rb @@ -12,7 +12,7 @@ class HttpParserTest < Test::Unit::TestCase parser = HttpParser.new req = {} http = "GET / HTTP/1.1\r\n\r\n" - nread = parser.execute(req, http); + nread = parser.execute(req, http, 0) assert nread == http.length, "Failed to parse the full HTTP request" assert parser.finished?, "Parser didn't finish" assert !parser.error?, "Parser had error" @@ -29,7 +29,7 @@ class HttpParserTest < Test::Unit::TestCase error = false begin - nread = parser.execute(req, bad_http) + nread = parser.execute(req, bad_http, 0) rescue => details error = true end @@ -61,7 +61,7 @@ class HttpParserTest < Test::Unit::TestCase 100.times do |c| get = "GET /#{rand_data(1024, 1024+(c*1024))} HTTP/1.1\r\n" assert_raises Mongrel::HttpParserError do - parser.execute({}, get) + parser.execute({}, get, 0) parser.reset end end @@ -70,7 +70,7 @@ class HttpParserTest < Test::Unit::TestCase 100.times do |c| get = "GET /#{rand_data(10,120)} HTTP/1.1\r\nX-#{rand_data(1024, 1024+(c*1024))}: Test\r\n\r\n" assert_raises Mongrel::HttpParserError do - parser.execute({}, get) + parser.execute({}, get, 0) parser.reset end end @@ -79,7 +79,7 @@ class HttpParserTest < Test::Unit::TestCase 100.times do |c| get = "GET /#{rand_data(10,120)} HTTP/1.1\r\nX-Test: #{rand_data(1024, 1024+(c*1024), false)}\r\n\r\n" assert_raises Mongrel::HttpParserError do - parser.execute({}, get) + parser.execute({}, get, 0) parser.reset end end @@ -88,7 +88,7 @@ class HttpParserTest < Test::Unit::TestCase get = "GET /#{rand_data(10,120)} HTTP/1.1\r\n" get << "X-Test: test\r\n" * (80 * 1024) assert_raises Mongrel::HttpParserError do - parser.execute({}, get) + parser.execute({}, get, 0) parser.reset end @@ -96,7 +96,7 @@ class HttpParserTest < Test::Unit::TestCase 10.times do |c| get = "GET #{rand_data(1024, 1024+(c*1024), false)} #{rand_data(1024, 1024+(c*1024), false)}\r\n\r\n" assert_raises Mongrel::HttpParserError do - parser.execute({}, get) + parser.execute({}, get, 0) parser.reset end end -- cgit v1.2.3-24-ge0c7