From 6b5b073d80d5790c24321a9d15484426341f8c13 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 30 Oct 2013 01:50:15 +0000 Subject: socket_helper: account for undefined options Not all servers may have options set, and we still need to set the default backlog. --- lib/yahns/socket_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/yahns/socket_helper.rb') 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) -- cgit v1.2.3-24-ge0c7