Check for SocketError on first ccc attempt
commit9cced5d3ace9fc333c95b63f443225887f774a47
authorJeremy Evans <code@jeremyevans.net>
Fri, 24 Mar 2017 20:03:46 +0000 (24 13:03 -0700)
committerEric Wong <e@80x24.org>
Fri, 24 Mar 2017 21:06:59 +0000 (24 21:06 +0000)
tree0bcc7b9f8ac03cfe70c2fbe9b9158185a1a6df15
parentd60cab29c91aec17859539f389e343f799b6f1b9
Check for SocketError on first ccc attempt

On OpenBSD, getsockopt(2) does not support TCP_INFO.  With the current code,
this results in a 500 for all clients if check_client_connection is enabled
on OpenBSD.

This patch rescues SocketError on the first getsockopt call, and
if SocketError is raised, it doesn't check in the future.  This
should be the same behavior as if TCP_INFO was supported but
inspect did not return a string in the expected format.
lib/unicorn/http_request.rb