From d07b6fd6888367c6230cf950d149bb6934ac11bf Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 2 Apr 2017 01:54:01 +0000 Subject: workaround for unicorn 5.3.0 unicorn 5.3.0 introduced a new Unicorn::TCPSrv and Unicorn::TCPClient constants to distinguish TCP sockets from Unix ones from its check_client_connection feature. These classes screw up our direct inheritance of Kgio::Socket from the Rainbows::Client class. Since we do not support check_client_connection, we do not need these new classes in unicorn. Removing Unicorn::TCPSrv and aliasing it as Kgio::TCPServer is sufficient for now. In the future, removing all kgio dependencies from Rainbows! will be prioritized. Thanks to Claudio Poli for reporting the bug: https://bogomips.org/rainbows-public/9267B33C-D13C-47E1-8892-4777B96DDCD1@gmail.com/ --- lib/rainbows.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/rainbows.rb b/lib/rainbows.rb index acfe911..584c94b 100644 --- a/lib/rainbows.rb +++ b/lib/rainbows.rb @@ -149,3 +149,12 @@ end require 'rainbows/error' require 'rainbows/configurator' + +module Unicorn + # this interferes with Rainbows::Client creation with unicorn 5.3 + begin + remove_const :TCPSrv + TCPSrv = Kgio::TCPServer + rescue NameError # unicorn < 5.3.0 + end +end -- cgit v1.2.3-24-ge0c7