Summary: Allows AsyncTransportWrapper's to supply the underlying application
protocol being used, for example using NPN for SSL or some other
generic protocol indication mechanism.
Reviewed By: ranjeeth
Differential Revision:
D2614179
fb-gh-sync-id:
2079782bb7d44f898fb14c7df15077209b022424
sslState_ == STATE_CONNECTING))));
}
+std::string AsyncSSLSocket::getApplicationProtocol() noexcept {
+ const unsigned char* protoName = nullptr;
+ unsigned protoLength;
+ if (getSelectedNextProtocolNoThrow(&protoName, &protoLength)) {
+ return std::string(reinterpret_cast<const char*>(protoName), protoLength);
+ }
+ return "";
+}
+
bool AsyncSSLSocket::isEorTrackingEnabled() const {
const BIO *wb = SSL_get_wbio(ssl_);
return wb && wb->method == &eorAwareBioMethod;
virtual void shutdownWriteNow() override;
virtual bool good() const override;
virtual bool connecting() const override;
+ virtual std::string getApplicationProtocol() noexcept override;
bool isEorTrackingEnabled() const override;
virtual void setEorTracking(bool track) override;
virtual AsyncTransportWrapper* getWrappedTransport() {
return nullptr;
}
+
+ /**
+ * Return the application protocol being used by the underlying transport
+ * protocol. This is useful for transports which are used to tunnel other
+ * protocols.
+ */
+ virtual std::string getApplicationProtocol() noexcept {
+ return "";
+ }
};
} // folly