From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id E6C3B2096C; Sun, 2 Apr 2017 01:54:01 +0000 (UTC) Date: Sun, 2 Apr 2017 01:54:01 +0000 From: Eric Wong To: Claudio Poli Cc: rainbows-public@bogomips.org Subject: [PATCH] workaround for unicorn 5.3.0 Message-ID: <20170402015401.GA19669@starla> References: <9267B33C-D13C-47E1-8892-4777B96DDCD1@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <9267B33C-D13C-47E1-8892-4777B96DDCD1@gmail.com> List-Id: 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/ --- This patch passes all tests, expect a release coming ASAP. Thanks again. 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 @@ def self.now # Ruby <= 2.0 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 -- EW