aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-01-21 23:38:41 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-01-21 23:38:41 +0000
commitfab2fd6398292e6ff16cc234021673e9852a150a (patch)
tree490371b3db7f0443efdadeb14a11083eaae95bf7
parent50e2df4268dca1873d9a9c99f35937f417379556 (diff)
downloadrails-fab2fd6398292e6ff16cc234021673e9852a150a.tar.gz
rails-fab2fd6398292e6ff16cc234021673e9852a150a.tar.bz2
rails-fab2fd6398292e6ff16cc234021673e9852a150a.zip
Fixed that static requests could unlock the mutex guarding dynamic requests in the WEBrick servlet (closes #3433) [tom@craz8.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3454 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r--railties/lib/webrick_server.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/railties/lib/webrick_server.rb b/railties/lib/webrick_server.rb
index f356eaf35e..cbaa1cb791 100644
--- a/railties/lib/webrick_server.rb
+++ b/railties/lib/webrick_server.rb
@@ -77,16 +77,16 @@ class DispatchServlet < WEBrick::HTTPServlet::AbstractServlet
end
def service(req, res) #:nodoc:
- begin
- unless handle_file(req, res)
+ unless handle_file(req, res)
+ begin
REQUEST_MUTEX.lock unless ActionController::Base.allow_concurrency
unless handle_dispatch(req, res)
raise WEBrick::HTTPStatus::NotFound, "`#{req.path}' not found."
end
- end
- ensure
- unless ActionController::Base.allow_concurrency
- REQUEST_MUTEX.unlock if REQUEST_MUTEX.locked?
+ ensure
+ unless ActionController::Base.allow_concurrency
+ REQUEST_MUTEX.unlock if REQUEST_MUTEX.locked?
+ end
end
end
end