Fix use of SSL session TransportInfo after txn is detached
authorViswanath Sivakumar <viswanath@fb.com>
Mon, 5 Jan 2015 18:46:07 +0000 (10:46 -0800)
committerViswanath Sivakumar <viswanath@fb.com>
Tue, 13 Jan 2015 19:01:03 +0000 (11:01 -0800)
commit9d0223804c0b12ac620cd9ed213ad6c303d1a2e0
tree889ed6b5fa42f4bd91ba0e312f326a7b74162991
parentdf2469a3b81a5c55d21975caa3d359af9bb2ca35
Fix use of SSL session TransportInfo after txn is detached

Summary:
De-couple TransportInfo fields from SSL session structs to avoid
dangling pointers.

Facebook:
We sometimes lazily copy TransportInfo in handler after
detachClientTransaction for logging. If the socket is closed, then this
creates dangling pointers to some SSL structs. This is an attempt to fix
that.

This is similar to what @ajitb did in
https://phabricator.fb.com/D1666951 which had to be abandoned because of
memory overhead. Here, instead of copying the relevant fields per
transaction, we are only doing it once per session (shared_ptr), so the
memory overhead should be negligible.

Test Plan: Unit tests pass. Will canary

Reviewed By: afrind@fb.com

Subscribers: fugalh, bmatheny, ssl-diffs@, folly-diffs@, ajitb

FB internal diff: D1757318

Tasks: 58656515879508

Signature: t1:1757318:1420482488:9f5144b499eb2086cf2a80243328db5715b48f88
folly/wangle/acceptor/Acceptor.cpp
folly/wangle/acceptor/TransportInfo.h