diff options
| author | gotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-05-31 06:53:58 +0000 |
|---|---|---|
| committer | gotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-05-31 06:53:58 +0000 |
| commit | be53970d786291a4a2c742109ccda693f39349c3 (patch) | |
| tree | 812bfb440a42df569d64324bc7c6dde500dc9a29 /lib/webrick/httpserver.rb | |
| parent | 08f79f0cb07e67e35714461ac90b201993dbc7a9 (diff) | |
| download | ruby-be53970d786291a4a2c742109ccda693f39349c3.tar.gz ruby-be53970d786291a4a2c742109ccda693f39349c3.tar.xz ruby-be53970d786291a4a2c742109ccda693f39349c3.zip | |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@8540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/webrick/httpserver.rb')
| -rw-r--r-- | lib/webrick/httpserver.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/webrick/httpserver.rb b/lib/webrick/httpserver.rb index bdd9c7a62..bce94746c 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 |
