aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/cgi_process.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller/cgi_process.rb')
-rw-r--r--actionpack/lib/action_controller/cgi_process.rb19
1 files changed, 12 insertions, 7 deletions
diff --git a/actionpack/lib/action_controller/cgi_process.rb b/actionpack/lib/action_controller/cgi_process.rb
index 5900540b80..4e3a1d270c 100644
--- a/actionpack/lib/action_controller/cgi_process.rb
+++ b/actionpack/lib/action_controller/cgi_process.rb
@@ -120,14 +120,19 @@ module ActionController #:nodoc:
convert_content_type!(@headers)
$stdout.binmode if $stdout.respond_to?(:binmode)
$stdout.sync = false
- print @cgi.header(@headers)
+
+ begin
+ print @cgi.header(@headers)
- if @cgi.send(:env_table)['REQUEST_METHOD'] == 'HEAD'
- return
- elsif @body.respond_to?(:call)
- @body.call(self)
- else
- print @body
+ if @cgi.send(:env_table)['REQUEST_METHOD'] == 'HEAD'
+ return
+ elsif @body.respond_to?(:call)
+ @body.call(self)
+ else
+ print @body
+ end
+ rescue Errno::EPIPE => e
+ # lost connection to the FCGI process -- ignore the output, then
end
end