about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-09-27 19:33:21 -0700
committerEric Wong <normalperson@yhbt.net>2009-09-27 19:33:21 -0700
commit3b0fcbf8baafbb88b2f15631b949fde9c8acff3b (patch)
treecb10bf3f62bb477891202ba598f32f891029a611
parent23fcda1c47db663ab8b809dc1dcae2726709dcc5 (diff)
downloadunicorn-3b0fcbf8baafbb88b2f15631b949fde9c8acff3b.tar.gz
Avoids making the #listen method any noisier than it should be.
-rw-r--r--lib/unicorn/configurator.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/unicorn/configurator.rb b/lib/unicorn/configurator.rb
index 114f4fb..a4335b9 100644
--- a/lib/unicorn/configurator.rb
+++ b/lib/unicorn/configurator.rb
@@ -51,6 +51,9 @@ module Unicorn
       self.config_file = defaults.delete(:config_file)
       set.merge!(DEFAULTS) if use_defaults
       defaults.each { |key, value| self.send(key, value) }
+      Hash === set[:listener_opts] or
+          set[:listener_opts] = Hash.new { |hash,key| hash[key] = {} }
+      Array === set[:listeners] or set[:listeners] = []
       reload
     end
 
@@ -231,8 +234,6 @@ module Unicorn
     def listen(address, opt = {})
       address = expand_addr(address)
       if String === address
-        Hash === set[:listener_opts] or
-          set[:listener_opts] = Hash.new { |hash,key| hash[key] = {} }
         [ :backlog, :sndbuf, :rcvbuf, :tries ].each do |key|
           value = opt[key] or next
           Integer === value or
@@ -250,7 +251,6 @@ module Unicorn
         set[:listener_opts][address].merge!(opt)
       end
 
-      set[:listeners] = [] unless Array === set[:listeners]
       set[:listeners] << address
     end