Skip to content

Commit

Permalink
Fixed CgiRequest#out to fall back to #write if doesn't have #syswrite…
Browse files Browse the repository at this point in the history
… [bitsweat]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@115 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
dhh committed Dec 12, 2004
1 parent 0990c13 commit ecb1d5a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 2 additions & 0 deletions 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:
Expand Down
14 changes: 10 additions & 4 deletions actionpack/lib/action_controller/base.rb
Expand Up @@ -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
Expand Down

0 comments on commit ecb1d5a

Please sign in to comment.