Check for Socket::TCP_INFO constant before trying to get TCP_INFO
commit477a2207869ff6b11a1cdee428b55604f2caa69e
authorDylan Thacker-Smith <dylan.smith@shopify.com>
Sun, 26 Mar 2017 01:49:03 +0000 (25 21:49 -0400)
committerEric Wong <e@80x24.org>
Sun, 26 Mar 2017 03:34:53 +0000 (26 03:34 +0000)
tree6c816d32d8ef949686386bfc27f346d76cb6bbcd
parent9cced5d3ace9fc333c95b63f443225887f774a47
Check for Socket::TCP_INFO constant before trying to get TCP_INFO

The ruby constant Socket::TCP_INFO is only defined if TCP_INFO is defined
in C, so we can just check for the presence of that ruby constant instead
of rescuing SocketError from the call to getsockopt.
lib/unicorn/http_request.rb