From 8f29e4838e58ce0db0557d56c756e9e644437111 Mon Sep 17 00:00:00 2001 From: Subodh Iyengar Date: Tue, 3 Nov 2015 17:19:40 -0800 Subject: [PATCH] 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 --- folly/io/async/AsyncTransport.h | 8 ++++++++ 1 file changed, 8 insertions(+) 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 -- 2.34.1