Skip to content

Commit 12f10f6

Browse files
author
David Heinemeier Hansson
committed
Only requests that require processing from a controller should block the webrick server -- requests for stylesheets, images, and the like should be concurrent
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@189 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
1 parent c4c6af3 commit 12f10f6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

railties/lib/webrick_server.rb

Lines changed: 2 additions & 3 deletions
Original file line numberOriginal file lineDiff line numberDiff line change
@@ -27,19 +27,18 @@ def initialize(server, options)
27

27

28
def do_GET(req, res)
28
def do_GET(req, res)
29
begin
29
begin
30-
REQUEST_MUTEX.lock
31-
32
unless handle_index(req, res)
30
unless handle_index(req, res)
33
unless handle_dispatch(req, res)
31
unless handle_dispatch(req, res)
34
unless handle_file(req, res)
32
unless handle_file(req, res)
33+
REQUEST_MUTEX.lock
35
unless handle_mapped(req, res)
34
unless handle_mapped(req, res)
36
raise WEBrick::HTTPStatus::NotFound, "`#{req.path}' not found."
35
raise WEBrick::HTTPStatus::NotFound, "`#{req.path}' not found."
37
end
36
end
38
end
37
end
39
end
38
end
40
end
39
end
41
ensure
40
ensure
42-
REQUEST_MUTEX.unlock
41+
REQUEST_MUTEX.unlock if REQUEST_MUTEX.locked?
43
end
42
end
44
end
43
end
45

44

0 commit comments

Comments
 (0)