about summary refs log tree commit homepage
path: root/lib/yahns/socket_helper.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2013-10-30 01:50:15 +0000
committerEric Wong <normalperson@yhbt.net>2013-10-30 07:00:58 +0000
commit6b5b073d80d5790c24321a9d15484426341f8c13 (patch)
tree5116aa022c8de3b39fbf586c31f992f72b7de39b /lib/yahns/socket_helper.rb
parentf6ade2928c3125155cbbe6bb7e3a496b98c218f7 (diff)
downloadyahns-6b5b073d80d5790c24321a9d15484426341f8c13.tar.gz
Not all servers may have options set, and we still need to set
the default backlog.
Diffstat (limited to 'lib/yahns/socket_helper.rb')
-rw-r--r--lib/yahns/socket_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/yahns/socket_helper.rb b/lib/yahns/socket_helper.rb
index 02cacee..0f9b3d9 100644
--- a/lib/yahns/socket_helper.rb
+++ b/lib/yahns/socket_helper.rb
@@ -20,7 +20,7 @@ module Yahns::SocketHelper # :nodoc:
   end
 
   def set_server_sockopt(sock, opt)
-    opt = {backlog: 1024}.merge!(opt) if opt
+    opt = {backlog: 1024}.merge!(opt || {})
     sock.close_on_exec = true
 
     TCPSocket === sock and sock.setsockopt(:IPPROTO_TCP, :TCP_NODELAY, 1)