From 8ce88a3756b110e5e3001f640ebd53a5b11d8c65 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 8 Mar 2017 00:52:23 +0000 Subject: revert signature change to HttpServer#process_client We can force kgio_tryaccept to return an internal class for TCP objects by subclassing Kgio::TCPServer. This avoids breakage in any unfortunate projects which depend on our undocumented internal APIs, such as gctools --- lib/unicorn/http_request.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/unicorn/http_request.rb') diff --git a/lib/unicorn/http_request.rb b/lib/unicorn/http_request.rb index 9acde50..68bde16 100644 --- a/lib/unicorn/http_request.rb +++ b/lib/unicorn/http_request.rb @@ -61,7 +61,7 @@ class Unicorn::HttpParser # returns an environment hash suitable for Rack if successful # This does minimal exception trapping and it is up to the caller # to handle any socket errors (e.g. user aborted upload). - def read(socket, listener) + def read(socket) clear e = env @@ -82,7 +82,7 @@ class Unicorn::HttpParser false until add_parse(socket.kgio_read!(16384)) end - check_client_connection(socket, listener) if @@check_client_connection + check_client_connection(socket) if @@check_client_connection e['rack.input'] = 0 == content_length ? NULL_IO : @@input_class.new(socket, self) @@ -105,8 +105,8 @@ class Unicorn::HttpParser end if defined?(Raindrops::TCP_Info) - def check_client_connection(socket, listener) # :nodoc: - if Kgio::TCPServer === listener + def check_client_connection(socket) # :nodoc: + if Unicorn::TCPClient === socket @@tcp_info ||= Raindrops::TCP_Info.new(socket) @@tcp_info.get!(socket) raise Errno::EPIPE, "client closed connection".freeze, @@ -127,7 +127,7 @@ class Unicorn::HttpParser end end else - def check_client_connection(socket, listener) # :nodoc: + def check_client_connection(socket) # :nodoc: write_http_header(socket) end end -- cgit v1.2.3-24-ge0c7