mirror of
https://github.com/github/rails.git
synced 2026-04-04 03:00:58 -04:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user