summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-04-21 06:23:21 +0000
committerEric Wong <normalperson@yhbt.net>2011-04-21 06:23:21 +0000
commit4f7f3bbb973c8f2bb4b189592158a0682ea2a625 (patch)
treee50ea03d74c835dc515ae56782c3bc864e717a7d
parentc6c9cae960bd8cbfa2feb801ca7079f6626b436b (diff)
Older Rainbows! redefines the ready_pipe= accessor method
to call internal after_fork hooks.
-rw-r--r--lib/unicorn/http_server.rb12
1 files 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