From: Subodh Iyengar Date: Wed, 4 Nov 2015 01:19:40 +0000 (-0800) Subject: Allow underlying transport to be accessible from AsyncTransportWrapper X-Git-Tag: deprecate-dynamic-initializer~279 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=folly.git;a=commitdiff_plain;h=8f29e4838e58ce0db0557d56c756e9e644437111 Allow underlying transport to be accessible from AsyncTransportWrapper Summary: Allow underlying transport to be accessible from AsyncTransportWrapper. There are some code paths where we need access to the real transport from the AsyncTransportWrapper. This allows us to retrieve the underlying transport and have clients like HTTPSession use it. Reviewed By: afrind Differential Revision: D2609200 fb-gh-sync-id: 2b317d1825a005bb64468f83c64bc3f1c9bdfe2c --- diff --git a/folly/io/async/AsyncTransport.h b/folly/io/async/AsyncTransport.h index ee8e8ea6..26cafbff 100644 --- a/folly/io/async/AsyncTransport.h +++ b/folly/io/async/AsyncTransport.h @@ -525,6 +525,14 @@ class AsyncTransportWrapper : virtual public AsyncTransport, virtual void writeChain(WriteCallback* callback, std::unique_ptr&& buf, WriteFlags flags = WriteFlags::NONE) override = 0; + /** + * The transport wrapper may wrap another transport. This returns the + * transport that is wrapped. It returns nullptr if there is no wrapped + * transport. + */ + virtual AsyncTransportWrapper* getWrappedTransport() { + return nullptr; + } }; } // folly