1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fixed CgiRequest#out to fall back to #write if doesn't have #syswrite [bitsweat]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@115 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson 2004-12-12 11:34:22 +00:00
parent 0990c1309d
commit ecb1d5afce
2 changed files with 12 additions and 4 deletions

View file

@ -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:

View file

@ -441,11 +441,17 @@ module ActionController #:nodoc:
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