From 3894044308b4dca842d458c336e3daca49450284 Mon Sep 17 00:00:00 2001 From: gotoyuzo Date: Tue, 31 May 2005 06:53:58 +0000 Subject: * lib/webrick/httpserver.rb (WEBrick::HTTPServer#run): should break the loop if the socket reached to EOF. [ruby-talk:142285] * lib/webrick/httpserver.rb (WEBrick::HTTPServer#run): send response without reading the whole request body if keep-alive is diabled. [experimental] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/webrick/httpserver.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/webrick') diff --git a/lib/webrick/httpserver.rb b/lib/webrick/httpserver.rb index bdd9c7a620..bce94746c2 100644 --- a/lib/webrick/httpserver.rb +++ b/lib/webrick/httpserver.rb @@ -53,6 +53,7 @@ module WEBrick timeout -= 0.5 end raise HTTPStatus::EOFError if timeout <= 0 + raise HTTPStatus::EOFError if sock.eof? req.parse(sock) res.request_method = req.request_method res.request_uri = req.request_uri @@ -79,7 +80,9 @@ module WEBrick res.set_error(ex, true) ensure if req.request_line - req.fixup() + if req.keep_alive? && res.keep_alive? + req.fixup() + end res.send_response(sock) server.access_log(@config, req, res) end -- cgit v1.2.3