aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2006-09-18 23:52:03 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2006-09-18 23:52:03 +0000
commit0da2357527f54662dbf05883253cacda10a5a36d (patch)
tree133706601dce52f33b7773050165d531043abd1c /actionpack
parentec030534b1d4786cc953ee95c912a72f650f5338 (diff)
downloadrails-0da2357527f54662dbf05883253cacda10a5a36d.tar.gz
rails-0da2357527f54662dbf05883253cacda10a5a36d.tar.bz2
rails-0da2357527f54662dbf05883253cacda10a5a36d.zip
Rescue Errno::ECONNRESET to handle an unexpectedly closed socket connection. Improves SCGI reliability. Closes #3368, closes #6226.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5146 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/CHANGELOG2
-rw-r--r--actionpack/lib/action_controller/cgi_process.rb8
2 files changed, 6 insertions, 4 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index c91a0dcde7..765ef51029 100644
--- a/actionpack/CHANGELOG
+++ b/actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Rescue Errno::ECONNRESET to handle an unexpectedly closed socket connection. Improves SCGI reliability. #3368, #6226 [sdsykes, fhanshaw@vesaria.com]
+
* Added that respond_to blocks will automatically set the content type to be the same as is requested [DHH]. Examples:
respond_to do |format|
diff --git a/actionpack/lib/action_controller/cgi_process.rb b/actionpack/lib/action_controller/cgi_process.rb
index 3170bc1ce7..5a08171ef2 100644
--- a/actionpack/lib/action_controller/cgi_process.rb
+++ b/actionpack/lib/action_controller/cgi_process.rb
@@ -173,7 +173,7 @@ end_msg
convert_content_type!(@headers)
output.binmode if output.respond_to?(:binmode)
output.sync = false if output.respond_to?(:sync=)
-
+
begin
output.write(@cgi.header(@headers))
@@ -189,8 +189,8 @@ end_msg
end
output.flush if output.respond_to?(:flush)
- rescue Errno::EPIPE => e
- # lost connection to the FCGI process -- ignore the output, then
+ rescue Errno::EPIPE, Errno::ECONNRESET
+ # lost connection to parent process, ignore output
end
end
@@ -207,4 +207,4 @@ end_msg
end
end
end
-end \ No newline at end of file
+end