summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-07-06 12:51:24 -0700
committerEric Wong <normalperson@yhbt.net>2010-07-06 14:39:40 -0700
commit8dbcf5390091b7aedf8c1f76ca11659c13d931b4 (patch)
tree76ae477f22ddd09ada03c76ee5f91361c92cf3f1
parent38b3c521be7715cdbdc406266e351765b2907ac1 (diff)
We only use this module in HttpServer and our unit test mocks
it properly.
(cherry picked from commit e0ea1e1548a807d152c0ffc175915e98addfe1f2)
-rw-r--r--lib/unicorn/socket_helper.rb11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/unicorn/socket_helper.rb b/lib/unicorn/socket_helper.rb
index 0369c92..769cdf1 100644
--- a/lib/unicorn/socket_helper.rb
+++ b/lib/unicorn/socket_helper.rb
@@ -101,14 +101,11 @@ module Unicorn
       end
       sock.listen(opt[:backlog] || 1024)
       rescue => e
-        if respond_to?(:logger)
-          logger.error "error setting socket options: #{e.inspect}"
-          logger.error e.backtrace.join("\n")
-        end
+        logger.error "error setting socket options: #{e.inspect}"
+        logger.error e.backtrace.join("\n")
     end
 
     def log_buffer_sizes(sock, pfx = '')
-      respond_to?(:logger) or return
       rcvbuf = sock.getsockopt(SOL_SOCKET, SO_RCVBUF).unpack('i')
       sndbuf = sock.getsockopt(SOL_SOCKET, SO_SNDBUF).unpack('i')
       logger.info "#{pfx}#{sock_name(sock)} rcvbuf=#{rcvbuf} sndbuf=#{sndbuf}"
@@ -123,9 +120,7 @@ module Unicorn
       sock = if address[0] == ?/
         if File.exist?(address)
           if File.socket?(address)
-            if self.respond_to?(:logger)
-              logger.info "unlinking existing socket=#{address}"
-            end
+            logger.info "unlinking existing socket=#{address}"
             File.unlink(address)
           else
             raise ArgumentError,