Revert "Wrap a transport as THeaderTransport only when it is not"

Summary: This reverts commit dd6c60aae56bca09dcad379b7097d2771479151a.
@override-unit-failures

Test Plan: It fixes twdeply

Reviewed By: alandau@fb.com

Subscribers: ruibalp, alandau, bmatheny

FB internal diff: D1561534
Respect smc thrift_transport if it is header

Summary:
This is the same as D1553342 and fixed the bug that
BaseTCPOverSSHThriftClient isn't fixed
@override-unit-failures

Test Plan: Test with the twdeploy issue

Reviewed By: alandau@fb.com

Subscribers: ruibalp, alandau, bmatheny

FB internal diff: D1561939
node C++ wrapped server

Summary:
Node.js wrapped Cpp server.  Node is single threaded, so we have to send everything back to the serve() event thread.  This probably needs a little polish - I think I need to delete the Persistent objects somewhere?

I couldn't get js_library rules to work - ThriftServer.js should be some library in thrift/lib/node instead of a file in thrift/perf/node

Test Plan:
patch in D1313868, then this diff to be able to build node extensions
fbconfig -r thrift/perf; fbmake opt
_bin/thrift/perf/node/MultiplexServer.jsar --port=1234 --server=[cpp|multiplex]
_bin/thrift/perf/cpp/loadgen -cpp2 -async -weight_noop=1

Using noops the wrapped server is about 10x faster.

Reviewed By: cpojer@fb.com

Subscribers: gothack, jhrbek, doug, alandau, bmatheny, jmarch

FB internal diff: D1329723

Tasks: 1914837
Move ThriftServer.js into a separate module

Summary:
This moves `ThriftServer.js` into a separate module by using
`js_npm_module`. This way the file can be reused across multiple
projects.

Also removed some leftover files and renamed the MultiplexServer back to its original name.

Test Plan: Reuse test plan from D1329723

Reviewed By: davejwatson@fb.com

Subscribers: alandau, bmatheny, laney, josh

FB internal diff: D1564309
fix krb5_get_error_message usage

Summary:
[found by LeakSanitizer] `krb5_get_error_message()` allocates
memory which should be released using `krb5_free_error_message()`.

Test Plan: fbconfig thrift/lib/cpp/util/kerberos --clang --with-project-version=clang:dev --sanitize=address && fbmake runtests_opt -j32

@override-unit-failures

Reviewed By: robot9@fb.com

Subscribers: alandau, bmatheny

FB internal diff: D1564916

Tasks: 5192243
don't template ThreadManager on semaphore type

Summary:
According to @davejwatson there only reason this was templated on SemType is because at the time folly::LifoSem was not yet open sourced. I couldn't find anyone using other semaphores, so here's a stab at killing it.
The template instantiation file was leaking a lot of include and using directives (including unique_ptr, shared_ptr, make_shared) into the rest of fbcode,
so this breaks a ton of builds. I made a couple of passes with sandcastle but I bet there are more...

Test Plan: thrft/lib/cpp/concurrency unit tests

Reviewed By: davejwatson@fb.com

Subscribers: jsedgwick, xie, atlas2-eng@, adsatlasreporting@, bisho, gunjan, hdoshi, chaoyc, search-fbcode-diffs@, lars, net-systems@, varunk, zeus-diffs@, andrewcox, vikas, danielg, oleksandr, tjackson, unicorn-diffs@, ldbrandy, vighnesh, netego-diffs@, fugalh, adamsyta, andreib, tw-eng@, vini, alandau, nkgupta, bmatheny, wormhole-diffs@, aco-diff@, leis, watashi, smarlow, akr, bnitka, jcoens, benj, bwester, nimishshah, davejwatson

FB internal diff: D1529242
move socketaddress to folly

Summary:
Goes with IPAddress and MACAddress already in folly.

* change namespace, add typedef in thrift.  Had to update forward decls to folly namespace.
* change exception types to std:: types instead of TTransportException.  I fbgs'd for everywhere I could find trying to catch these and updated the type, there looked like there were only ~9 files or so.

Test Plan: contbuild.

@override-unit-failures

Tests already passed in last run

Reviewed By: simpkins@fb.com

Subscribers: doug, ps, alandau, everstore-dev@, njormrod, fugalh, alikhtarov, bmatheny, jsedgwick

FB internal diff: D1556916
Reattaching the evb should mark the channel as available

Summary:
hitesh was working on a diff (D1561106) which required detaching / reattaching an evb from the channel. Once he detached it, it basically permanently broke the channel for security use.

When the next request was fired with security enabled on this channel, we returned here: https://phabricator.fb.com/diffusion/FBCODE/browse/master/thrift/lib/cpp2/async/GssSaslClient.cpp;84e048fe2b54de77f27f1d8aadae73a114c9a8ef$101. saslStarted was never called, so the sasl timeout was never set. As a result, the channel was left in a hung state.

Test Plan: _bin/servicerouter/client/cpp2/test/dispatcher2test --fbunit_test_regexp=TestTCPHealthCheckConnectionPoolingSecurity

Reviewed By: mhorowitz@fb.com

Subscribers: alandau, bmatheny, wstefancik

FB internal diff: D1562511
fix autotools build

Summary: Whoops, missed this one when moving it to folly

Test Plan: jenkins build

Reviewed By: ckwalsh@fb.com

Subscribers: doug, alandau, bmatheny

FB internal diff: D1566485
moar makeifle.am fixes

Summary: Ugh this still exists and needs to be installed.

Test Plan: fbthrift_ci jenkins build should pass

Reviewed By: haijunz@fb.com

Subscribers: doug, alandau, bmatheny

FB internal diff: D1566619
Change TAsyncSSLSocketTransportFactory's timeout impl

Summary:
- Change TAsyncSSLSocketTransportFactory to use the timeout
implementation from TAsyncSSLSocket::sslConnect(). No need to
re-implement it ourselves.
- Update TAsyncSSLSocket to expose methods for setting the
TimeoutManager being used by the HandshakeTimeout object. This really
just extends the attachEventBase() method we already had to account
for TimeoutManager as well.
- Change MockTAsyncSSLSocket::sslConnect() to a non-mocked function that
sets up state like TAsyncSSLSocket does, before invoking
sslConnectMocked().

Test Plan:
- Unit tests

Reviewed By: shikong@fb.com

Subscribers: davejwatson, trunkagent, doug, alandau, bmatheny, ssl-diffs@, seanc

FB internal diff: D1566247

Tasks: 1926422
Add IThriftStruct interface to structs in php/hack

@override-unit-failures

Test Plan: Generate php/hack code, php -l

Reviewed By: haijunz@fb.com

Subscribers: alandau, bmatheny

FB internal diff: D1566903
fix response from CppServerWrapper

Summary: Credit to @davejwatson for figuring this one out.  We weren't respecting the transport layer.

Test Plan: confirm against repro from https://our.intern.facebook.com/intern/tasks/?t=5184499

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

Subscribers: ruibalp, alandau, bmatheny

FB internal diff: D1567072

Tasks: 5178174, 5123297, 5184499
Bump version to 8:0