diff options
| author | gotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-12-09 07:22:45 +0000 |
|---|---|---|
| committer | gotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-12-09 07:22:45 +0000 |
| commit | 23179ff96ec19573d532939037e6677c11b1e05a (patch) | |
| tree | ee67d0a5194ec1d40e5b3dfb48f108d5893cb331 /lib/webrick/httpserver.rb | |
| parent | d9287331a9cf213a89d768b789b5aa919eae4e52 (diff) | |
| download | ruby-23179ff96ec19573d532939037e6677c11b1e05a.tar.gz ruby-23179ff96ec19573d532939037e6677c11b1e05a.tar.xz ruby-23179ff96ec19573d532939037e6677c11b1e05a.zip | |
* lib/webrick/cgi.rb (WEBrick::CGI#setup_header): avoid
SecurityError. [ruby-dev:24970]
* lib/webrick/httpserver.rb (WEBrick::HTTPServer#run): should wait
for reading request till data arrive. [ruby-talk:121068]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/webrick/httpserver.rb')
| -rw-r--r-- | lib/webrick/httpserver.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/webrick/httpserver.rb b/lib/webrick/httpserver.rb index 13574e7de..bdd9c7a62 100644 --- a/lib/webrick/httpserver.rb +++ b/lib/webrick/httpserver.rb @@ -46,6 +46,13 @@ module WEBrick req = HTTPRequest.new(@config) server = self begin + timeout = @config[:RequestTimeout] + while timeout > 0 + break if IO.select([sock], nil, nil, 0.5) + timeout = 0 if @status != :Running + timeout -= 0.5 + end + raise HTTPStatus::EOFError if timeout <= 0 req.parse(sock) res.request_method = req.request_method res.request_uri = req.request_uri |
