apply all sockopts to listening sockets
authorSatadru Pan <satadru@fb.com>
Fri, 16 Jan 2015 20:05:10 +0000 (12:05 -0800)
committerwoo <woo@fb.com>
Mon, 2 Feb 2015 21:11:26 +0000 (13:11 -0800)
commit292de17c27f805ce961678b007e307e0d4ca7eb9
treeeaaa797aca3d8ec903d7514da87780bb168c48ed
parent98c4cba4a6bc766a361680664176901bb13d8697
apply all sockopts to listening sockets

Summary:
We want all socket options to be applied to the listen sockets too.

The old code here that only applied SO_KEEPALIVE is a bit superstitious.
Not all options will be inherited by accept()ed sockets, but that's
fine.  We set them again post-accept().

Applying all these options to the listening sockets will fix at least
one long standing bug, which is that QoS is not set correctly for the
first few packets in a flow.  This also will let us do the right thing
when we gain the ability to set TCP_MAXSEG in D1741753.

Test Plan: fbmake runtests & canary in prod

Reviewed By: afrind@fb.com, davejwatson@fb.com

Subscribers: jsedgwick, satadru, trunkagent, fugalh, exa, folly-diffs@, agartrell

FB internal diff: D1745182

Tasks: 2911597

Signature: t1:1745182:1418860157:045680a91b153482bcd4a014894fb28059955d06
folly/wangle/acceptor/Acceptor.cpp