diff options
author | Jamis Buck <jamis@37signals.com> | 2005-05-30 09:00:46 +0000 |
---|---|---|
committer | Jamis Buck <jamis@37signals.com> | 2005-05-30 09:00:46 +0000 |
commit | f8542a64b30bb6f67bcedf0c82de1291aab3c3d9 (patch) | |
tree | 375ae117198ca6f03526a0cbfcfc9f1729bf6027 /actionpack/lib/action_controller | |
parent | f57ee365e154ce6d15cd168112d94a9a8ff27094 (diff) | |
download | rails-f8542a64b30bb6f67bcedf0c82de1291aab3c3d9.tar.gz rails-f8542a64b30bb6f67bcedf0c82de1291aab3c3d9.tar.bz2 rails-f8542a64b30bb6f67bcedf0c82de1291aab3c3d9.zip |
Make sure the benchmarking render method always returns the result of the render, regardless of whether logging is enabled or not.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1371 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/benchmarking.rb | 6 | ||||
-rw-r--r-- | actionpack/lib/action_controller/cgi_ext/raw_post_data_fix.rb | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/benchmarking.rb b/actionpack/lib/action_controller/benchmarking.rb index 6a78ad5dac..55aed1bca1 100644 --- a/actionpack/lib/action_controller/benchmarking.rb +++ b/actionpack/lib/action_controller/benchmarking.rb @@ -20,13 +20,17 @@ module ActionController #:nodoc: render_without_benchmark(options, deprecated_status) else db_runtime = ActiveRecord::Base.connection.reset_runtime if Object.const_defined?("ActiveRecord") && ActiveRecord::Base.connected? - @rendering_runtime = Benchmark::measure{ render_without_benchmark(options, deprecated_status) }.real + + render_output = nil + @rendering_runtime = Benchmark::measure{ render_output = render_without_benchmark(options, deprecated_status) }.real if Object.const_defined?("ActiveRecord") && ActiveRecord::Base.connected? @db_rt_before_render = db_runtime @db_rt_after_render = ActiveRecord::Base.connection.reset_runtime @rendering_runtime -= @db_rt_after_render end + + render_output end end diff --git a/actionpack/lib/action_controller/cgi_ext/raw_post_data_fix.rb b/actionpack/lib/action_controller/cgi_ext/raw_post_data_fix.rb index 11b36e0dd4..5cb13c2456 100644 --- a/actionpack/lib/action_controller/cgi_ext/raw_post_data_fix.rb +++ b/actionpack/lib/action_controller/cgi_ext/raw_post_data_fix.rb @@ -18,7 +18,9 @@ class CGI #:nodoc: end private - MULTIPART_FORM_BOUNDARY_RE = %r|\Amultipart/form-data.*boundary=\"?([^\";,]+)\"?|n #" + unless defined?(MULTIPART_FORM_BOUNDARY_RE) + MULTIPART_FORM_BOUNDARY_RE = %r|\Amultipart/form-data.*boundary=\"?([^\";,]+)\"?|n #" + end def multipart_form_boundary if env_table['REQUEST_METHOD'] == 'POST' |