diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index 89c834dd47f16ad0d47f942ba1383750b6a7f996..d31e2f15fea938e2621a2f2e8b83e7167b3700cf 100644 --- a/actionpack/CHANGELOG +++ b/actionpack/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Fixed CgiRequest#out to fall back to #write if $stdout doesn't have #syswrite [bitsweat] + * Fixed all helpers so that they use XHTML compliant double quotes for values instead of single quotes [htonl/bitsweat] * Added link_to_image(src, options = {}, html_options = {}, *parameters_for_method_reference). Documentation: diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index e0c3fb01bf1efcb239086c3cf759b56274f9127d..a7271e9c91a5a1c908b02dec23499bfc9b7c520e 100755 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -441,11 +441,17 @@ def send_file(path, options = {}) logger.info "Streaming file #{path}" unless logger.nil? len = options[:buffer_size] || 4096 File.open(path, 'rb') do |file| - begin - while true - $stdout.syswrite file.sysread(len) + if $stdout.respond_to?(:syswrite) + begin + while true + $stdout.syswrite file.sysread(len) + end + rescue EOFError + end + else + while buf = file.read(len) + $stdout.write buf end - rescue EOFError end end end