This allows us to more easilly override and invoke super
via other included modules.
---
 lib/yahns/acceptor.rb    | 2 +-
 lib/yahns/http_client.rb | 2 +-
 lib/yahns/rack.rb        | 3 ++-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/yahns/acceptor.rb b/lib/yahns/acceptor.rb
index cd9e055..3e67aba 100644
--- a/lib/yahns/acceptor.rb
+++ b/lib/yahns/acceptor.rb
@@ -43,7 +43,7 @@ module Yahns::Acceptor # :nodoc:
         queue = client_class.queue
         t = Thread.current
         accept_flags = Kgio::SOCK_NONBLOCK | Kgio::SOCK_CLOEXEC
-        qev_flags = client_class.superclass::QEV_FLAGS
+        qev_flags = client_class.const_get(:QEV_FLAGS)
         begin
           # We want the accept/accept4 syscall to be _blocking_
           # so it can distribute work evenly between processes
diff --git a/lib/yahns/http_client.rb b/lib/yahns/http_client.rb
index a294511..371182e 100644
--- a/lib/yahns/http_client.rb
+++ b/lib/yahns/http_client.rb
@@ -1,7 +1,7 @@
 # -*- encoding: binary -*-
 # Copyright (C) 2013, Eric Wong <normalper...@yhbt.net> and all contributors
 # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
-class Yahns::HttpClient < Kgio::Socket # :nodoc:
+module Yahns::HttpClient # :nodoc: < Kgio::Socket # :nodoc:
   NULL_IO = StringIO.new("")
 
   # FIXME: we shouldn't have this at all
diff --git a/lib/yahns/rack.rb b/lib/yahns/rack.rb
index 3f8f6b7..2b1a0f4 100644
--- a/lib/yahns/rack.rb
+++ b/lib/yahns/rack.rb
@@ -39,7 +39,8 @@ class Yahns::Rack # :nodoc:
   end
 
   def config_context
-    ctx_class = Class.new(Yahns::HttpClient)
+    ctx_class = Class.new(Kgio::Socket)
+    ctx_class.__send__(:include, Yahns::HttpClient)
     ctx_class.extend(Yahns::HttpContext)
     ctx_class.http_ctx_init(self)
     ctx_class
-- 
EW


Reply via email to