aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/cgi_process.rb2
-rw-r--r--actionpack/lib/action_controller/streaming.rb8
2 files changed, 5 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/cgi_process.rb b/actionpack/lib/action_controller/cgi_process.rb
index 8c472c5514..4413a29791 100644
--- a/actionpack/lib/action_controller/cgi_process.rb
+++ b/actionpack/lib/action_controller/cgi_process.rb
@@ -145,7 +145,7 @@ module ActionController #:nodoc:
if @cgi.send(:env_table)['REQUEST_METHOD'] == 'HEAD'
return
elsif @body.respond_to?(:call)
- @body.call(self)
+ @body.call(self, output)
else
output.write(@body)
end
diff --git a/actionpack/lib/action_controller/streaming.rb b/actionpack/lib/action_controller/streaming.rb
index 2914fd907b..0280522e13 100644
--- a/actionpack/lib/action_controller/streaming.rb
+++ b/actionpack/lib/action_controller/streaming.rb
@@ -61,20 +61,20 @@ module ActionController #:nodoc:
@performed_render = false
if options[:stream]
- render :text => Proc.new {
+ render :text => Proc.new { |response, output|
logger.info "Streaming file #{path}" unless logger.nil?
len = options[:buffer_size] || 4096
File.open(path, 'rb') do |file|
- if $stdout.respond_to?(:syswrite)
+ if output.respond_to?(:syswrite)
begin
while true
- $stdout.syswrite file.sysread(len)
+ output.syswrite(file.sysread(len))
end
rescue EOFError
end
else
while buf = file.read(len)
- $stdout.write buf
+ output.write(buf)
end
end
end