From 4f7f3bbb973c8f2bb4b189592158a0682ea2a625 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 21 Apr 2011 06:23:21 +0000 Subject: http_server: fix Rainbows! compatibility Older Rainbows! redefines the ready_pipe= accessor method to call internal after_fork hooks. --- lib/unicorn/http_server.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb index 7ed26ca..d70de45 100644 --- a/lib/unicorn/http_server.rb +++ b/lib/unicorn/http_server.rb @@ -99,7 +99,7 @@ class Unicorn::HttpServer @request = Unicorn::HttpRequest.new self.reexec_pid = 0 options = options.dup - self.ready_pipe = options.delete(:ready_pipe) + @ready_pipe = options.delete(:ready_pipe) self.init_listeners = options[:listeners] ? options[:listeners].dup : [] options[:use_defaults] = true self.config = Unicorn::Configurator.new(options) @@ -282,10 +282,10 @@ class Unicorn::HttpServer proc_name 'master' logger.info "master process ready" # test_exec.rb relies on this message - if ready_pipe - ready_pipe.syswrite($$.to_s) - ready_pipe.close rescue nil - self.ready_pipe = nil + if @ready_pipe + @ready_pipe.syswrite($$.to_s) + @ready_pipe.close rescue nil + @ready_pipe = nil end begin reap_all_workers @@ -491,7 +491,7 @@ class Unicorn::HttpServer def after_fork_internal @ready_pipe.close if @ready_pipe - @ready_pipe = nil + self.ready_pipe = nil # XXX Rainbows! compat, change for Unicorn 4.x tmp = srand # http://redmine.ruby-lang.org/issues/4338 # The OpenSSL PRNG is seeded with only the pid, and apps with frequently -- cgit v1.2.3-24-ge0c7