Rainbows! Rack HTTP server user/dev discussion
 help / Atom feed
From: Eric Wong <e@80x24.org>
To: Claudio Poli <masterkain@gmail.com>
Cc: rainbows-public@bogomips.org
Subject: [PATCH] workaround for unicorn 5.3.0
Date: Sun, 2 Apr 2017 01:54:01 +0000
Message-ID: <20170402015401.GA19669@starla> (raw)
In-Reply-To: <9267B33C-D13C-47E1-8892-4777B96DDCD1@gmail.com>

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

      parent reply index

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-02  0:05 undefined method `process_loop' for #<Unicorn::TCPClient:fd 14> Claudio Poli
2017-04-02  0:26 ` Eric Wong
2017-04-02  0:32   ` Eric Wong
2017-04-02 23:21     ` Claudio Poli
     [not found]       ` <CANp6QoJXRbPLqmOPpG7XmZBc+oYqLWCcq1ipvOyNEQPXDEwx9Q@mail.gmail.com>
2018-01-19 17:07         ` Eric Wong
     [not found]           ` <B05FC728-A46F-4056-997D-0BEE64A9A110@gmail.com>
2018-01-30 21:13             ` Eric Wong
2017-04-02  1:54 ` Eric Wong [this message]

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://bogomips.org/rainbows/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170402015401.GA19669@starla \
    --to=e@80x24.org \
    --cc=masterkain@gmail.com \
    --cc=rainbows-public@bogomips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Rainbows! Rack HTTP server user/dev discussion

Archives are clonable:
	git clone --mirror https://bogomips.org/rainbows-public
	git clone --mirror http://ou63pmih66umazou.onion/rainbows-public

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.lang.ruby.rainbows
	nntp://ou63pmih66umazou.onion/inbox.comp.lang.ruby.rainbows

 note: .onion URLs require Tor: https://www.torproject.org/
       or Tor2web: https://www.tor2web.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox