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
This commit is contained in:
David Heinemeier Hansson
2006-01-21 23:38:41 +00:00
parent 50e2df4268
commit fab2fd6398

View File

@@ -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