Skip to content
Browse files

Fixed that static requests could unlock the mutex guarding dynamic re…

…quests 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
  • Loading branch information...
1 parent 50e2df4 commit fab2fd6398292e6ff16cc234021673e9852a150a @dhh dhh committed
Showing with 6 additions and 6 deletions.
  1. +6 −6 railties/lib/webrick_server.rb
View
12 railties/lib/webrick_server.rb
@@ -77,16 +77,16 @@ def initialize(server, options) #:nodoc:
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

0 comments on commit fab2fd6

Please sign in to comment.
Something went wrong with that request. Please try again.