Commit 08f64cbb authored by Petr Lapukhov's avatar Petr Lapukhov Committed by Facebook Github Bot

Have reserved sockopt to disable TSOCKS

Summary: as title, similar to TTLS

Reviewed By: djwatson

Differential Revision: D5284200

fbshipit-source-id: 7eb95668740b239349c6e73f3b152e6506671072
parent f975d3c5
......@@ -520,6 +520,11 @@ int AsyncSocket::socketConnect(const struct sockaddr* saddr, socklen_t len) {
// Ignore return value, errors are ok
setsockopt(fd_, SOL_SOCKET, SO_NO_TRANSPARENT_TLS, nullptr, 0);
}
if (noTSocks_) {
VLOG(4) << "Disabling TSOCKS for fd " << fd_;
// Ignore return value, errors are ok
setsockopt(fd_, SOL_SOCKET, SO_NO_TSOCKS, nullptr, 0);
}
#endif
int rv = fsp::connect(fd_, saddr, len);
if (rv < 0) {
......
......@@ -68,6 +68,10 @@ namespace folly {
#define SO_NO_TRANSPARENT_TLS 200
#endif
#if defined __linux__ && !defined SO_NO_TSOCKS
#define SO_NO_TSOCKS 201
#endif
#ifdef _MSC_VER
// We do a dynamic_cast on this, in
// AsyncTransportWrapper::getUnderlyingTransport so be safe and
......@@ -761,6 +765,10 @@ class AsyncSocket : virtual public AsyncTransportWrapper {
noTransparentTls_ = true;
}
void disableTSocks() {
noTSocks_ = true;
}
enum class StateEnum : uint8_t {
UNINIT,
CONNECTING,
......@@ -1157,6 +1165,7 @@ class AsyncSocket : virtual public AsyncTransportWrapper {
bool tfoAttempted_{false};
bool tfoFinished_{false};
bool noTransparentTls_{false};
bool noTSocks_{false};
// Whether to track EOR or not.
bool trackEor_{false};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment