Line data Source code
1 : #include "source/extensions/transport_sockets/internal_upstream/internal_upstream.h" 2 : 3 : namespace Envoy { 4 : namespace Extensions { 5 : namespace TransportSockets { 6 : namespace InternalUpstream { 7 : 8 : InternalSocket::InternalSocket(Network::TransportSocketPtr inner_socket, 9 : std::unique_ptr<envoy::config::core::v3::Metadata> metadata, 10 : const StreamInfo::FilterState::Objects& filter_state_objects) 11 : : PassthroughSocket(std::move(inner_socket)), metadata_(std::move(metadata)), 12 0 : filter_state_objects_(filter_state_objects) {} 13 : 14 0 : void InternalSocket::setTransportSocketCallbacks(Network::TransportSocketCallbacks& callbacks) { 15 0 : transport_socket_->setTransportSocketCallbacks(callbacks); 16 0 : auto* io_handle = dynamic_cast<IoSocket::UserSpace::IoHandle*>(&callbacks.ioHandle()); 17 0 : if (io_handle != nullptr && io_handle->passthroughState()) { 18 0 : io_handle->passthroughState()->initialize(std::move(metadata_), filter_state_objects_); 19 0 : } 20 0 : metadata_ = nullptr; 21 0 : filter_state_objects_.clear(); 22 0 : } 23 : 24 : } // namespace InternalUpstream 25 : } // namespace TransportSockets 26 : } // namespace Extensions 27 : } // namespace Envoy