diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-04-10 14:58:48 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-04-10 15:12:21 -0700 |
commit | 3e9fe197d4daac14fa98addfcf9be3208c7b96b8 (patch) | |
tree | dca6a4d119af3b2b1da1b206d6a5064731d5a1f6 /lib/unicorn.rb | |
parent | 0bd8cb742eadf45969133c13ebc5252b5234ef92 (diff) | |
download | unicorn-3e9fe197d4daac14fa98addfcf9be3208c7b96b8.tar.gz |
Apparently I was smoking crack and thought they weren't changeable. Additionally, SO_REUSEADDR is set by TCPServer.new, so there's no need to set it ourselves; so avoid putting extra items in the purgatory. This allows SIGHUP to change listen options.
Diffstat (limited to 'lib/unicorn.rb')
-rw-r--r-- | lib/unicorn.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/unicorn.rb b/lib/unicorn.rb index 2883bc2..fd66529 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -74,7 +74,7 @@ module Unicorn # before they become UNIXServer or TCPServer inherited = ENV['UNICORN_FD'].to_s.split(/,/).map do |fd| io = Socket.for_fd(fd.to_i) - set_server_sockopt(io) + set_server_sockopt(io, @listener_opts[sock_name(io)]) @io_purgatory << io logger.info "inherited addr=#{sock_name(io)} fd=#{fd}" server_cast(io) @@ -125,6 +125,7 @@ module Unicorn end (io.close rescue nil).nil? # true else + set_server_sockopt(io, @listener_opts[sock_name(io)]) false end end @@ -153,7 +154,7 @@ module Unicorn return if String === address && listener_names.include?(address) if io = bind_listen(address, opt) - if Socket == io.class + unless TCPServer === io || UNIXServer === io @io_purgatory << io io = server_cast(io) end |