From 3e9fe197d4daac14fa98addfcf9be3208c7b96b8 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 10 Apr 2009 14:58:48 -0700 Subject: listen backlog, sndbuf, rcvbuf are always changeable 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. --- lib/unicorn.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/unicorn.rb') 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 -- cgit v1.2.3-24-ge0c7