[DRE-commits] [unicorn] 03/04: update patches
Hleb Valoshka
tsfgnu-guest at alioth.debian.org
Thu Nov 7 09:30:34 UTC 2013
This is an automated email from the git hooks/post-receive script.
tsfgnu-guest pushed a commit to branch master
in repository unicorn.
commit e27caa2c3e09d9166372d3130bb5706938d6eba7
Author: Hleb Valoshka <375GNU at Gmail.COM>
Date: Thu Nov 7 12:12:19 2013 +0300
update patches
---
...-improve-handling-of-client-triggerable-s.patch | 46 --------------------
...O_REUSEPORT-tests-for-old-Linux-and-non-L.patch | 23 ++++++++++
debian/patches/series | 2 +-
3 files changed, 24 insertions(+), 47 deletions(-)
diff --git a/debian/patches/0002-http_server-improve-handling-of-client-triggerable-s.patch b/debian/patches/0002-http_server-improve-handling-of-client-triggerable-s.patch
deleted file mode 100644
index 1960e0e..0000000
--- a/debian/patches/0002-http_server-improve-handling-of-client-triggerable-s.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From: Eric Wong <normalperson at yhbt.net>
-Date: Sat, 17 Aug 2013 01:20:11 +0000
-Subject: http_server: improve handling of client-triggerable socket errors
-
-We do not attempt to write HTTP responses for socket errors if
-clients disconnect from us unexpectedly.
-
-Additionally, we do not hide backtraces EINVAL/EBADF errors, since
-they are indicative of real bugs which must be fixed.
-
-We do continue to hide hide EOF, ECONNRESET, ENOTCONN, and EPIPE
-because clients (even "friendly") ones will break connections due to
-client crashes or network failure (which is common for me :P), and
-the backtraces from those will cause excessive logging and even
-become a DoS vector.
----
- lib/unicorn/http_server.rb | 9 +++++----
- 1 file changed, 5 insertions(+), 4 deletions(-)
-
-diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb
-index cc0a705..bed24d0 100644
---- a/lib/unicorn/http_server.rb
-+++ b/lib/unicorn/http_server.rb
-@@ -520,9 +520,8 @@ class Unicorn::HttpServer
- # the socket is closed at the end of this function
- def handle_error(client, e)
- code = case e
-- when EOFError,Errno::ECONNRESET,Errno::EPIPE,Errno::EINVAL,Errno::EBADF,
-- Errno::ENOTCONN
-- 500
-+ when EOFError,Errno::ECONNRESET,Errno::EPIPE,Errno::ENOTCONN
-+ # client disconnected on us and there's nothing we can do
- when Unicorn::RequestURITooLongError
- 414
- when Unicorn::RequestEntityTooLargeError
-@@ -533,7 +532,9 @@ class Unicorn::HttpServer
- Unicorn.log_error(@logger, "app error", e)
- 500
- end
-- client.kgio_trywrite(err_response(code, @request.response_start_sent))
-+ if code
-+ client.kgio_trywrite(err_response(code, @request.response_start_sent))
-+ end
- client.close
- rescue
- end
diff --git a/debian/patches/0002-tests-fix-SO_REUSEPORT-tests-for-old-Linux-and-non-L.patch b/debian/patches/0002-tests-fix-SO_REUSEPORT-tests-for-old-Linux-and-non-L.patch
new file mode 100644
index 0000000..c88bf1c
--- /dev/null
+++ b/debian/patches/0002-tests-fix-SO_REUSEPORT-tests-for-old-Linux-and-non-L.patch
@@ -0,0 +1,23 @@
+From: Eric Wong <normalperson at yhbt.net>
+Date: Mon, 4 Nov 2013 18:28:46 +0000
+Subject: tests: fix SO_REUSEPORT tests for old Linux and non-Linux
+
+---
+ test/unit/test_socket_helper.rb | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/test/unit/test_socket_helper.rb b/test/unit/test_socket_helper.rb
+index abc177b..8992757 100644
+--- a/test/unit/test_socket_helper.rb
++++ b/test/unit/test_socket_helper.rb
+@@ -190,6 +190,8 @@ class TestSocketHelper < Test::Unit::TestCase
+ name = "#@test_addr:#{port}"
+ sock = bind_listen(name, :reuseport => true)
+ cur = sock.getsockopt(Socket::SOL_SOCKET, SO_REUSEPORT).unpack('i')[0]
+- assert_equal 1, cur
+- end if defined?(SO_REUSEPORT)
++ assert_operator cur, :>, 0
++ rescue Errno::ENOPROTOOPT
++ # kernel does not support SO_REUSEPORT (older Linux)
++ end
+ end
diff --git a/debian/patches/series b/debian/patches/series
index 0532401..3782c44 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,2 @@
0001-explicitly-use-escaped-minus-in-man-pages.patch
-0002-http_server-improve-handling-of-client-triggerable-s.patch
+0002-tests-fix-SO_REUSEPORT-tests-for-old-Linux-and-non-L.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/unicorn.git
More information about the Pkg-ruby-extras-commits
mailing list