aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/streaming.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller/streaming.rb')
-rw-r--r--actionpack/lib/action_controller/streaming.rb15
1 files changed, 3 insertions, 12 deletions
diff --git a/actionpack/lib/action_controller/streaming.rb b/actionpack/lib/action_controller/streaming.rb
index 618888d096..dfc9cdc274 100644
--- a/actionpack/lib/action_controller/streaming.rb
+++ b/actionpack/lib/action_controller/streaming.rb
@@ -69,17 +69,8 @@ module ActionController #:nodoc:
logger.info "Streaming file #{path}" unless logger.nil?
len = options[:buffer_size] || 4096
File.open(path, 'rb') do |file|
- if output.respond_to?(:syswrite)
- begin
- while true
- output.syswrite(file.sysread(len))
- end
- rescue EOFError
- end
- else
- while buf = file.read(len)
- output.write(buf)
- end
+ while buf = file.read(len)
+ output.write(buf)
end
end
}
@@ -125,7 +116,7 @@ module ActionController #:nodoc:
end
disposition = options[:disposition].dup || 'attachment'
-
+
disposition <<= %(; filename="#{options[:filename]}") if options[:filename]
@headers.update(