1
#include "source/extensions/transport_sockets/common/passthrough.h"
2

            
3
#include "envoy/network/connection.h"
4
#include "envoy/network/transport_socket.h"
5

            
6
#include "source/common/buffer/buffer_impl.h"
7

            
8
namespace Envoy {
9
namespace Extensions {
10
namespace TransportSockets {
11

            
12
PassthroughSocket::PassthroughSocket(Network::TransportSocketPtr&& transport_socket)
13
123
    : transport_socket_(std::move(transport_socket)) {}
14

            
15
1
void PassthroughSocket::setTransportSocketCallbacks(Network::TransportSocketCallbacks& callbacks) {
16
1
  transport_socket_->setTransportSocketCallbacks(callbacks);
17
1
}
18

            
19
13
std::string PassthroughSocket::protocol() const { return transport_socket_->protocol(); }
20

            
21
162
absl::string_view PassthroughSocket::failureReason() const {
22
162
  return transport_socket_->failureReason();
23
162
}
24

            
25
1
bool PassthroughSocket::canFlushClose() { return transport_socket_->canFlushClose(); }
26

            
27
50
Api::SysCallIntResult PassthroughSocket::connect(Network::ConnectionSocket& socket) {
28
50
  return transport_socket_->connect(socket);
29
50
}
30

            
31
46
void PassthroughSocket::closeSocket(Network::ConnectionEvent event) {
32
46
  transport_socket_->closeSocket(event);
33
46
}
34

            
35
49
Network::IoResult PassthroughSocket::doRead(Buffer::Instance& buffer) {
36
49
  return transport_socket_->doRead(buffer);
37
49
}
38

            
39
69
Network::IoResult PassthroughSocket::doWrite(Buffer::Instance& buffer, bool end_stream) {
40
69
  return transport_socket_->doWrite(buffer, end_stream);
41
69
}
42

            
43
69
void PassthroughSocket::onConnected() { transport_socket_->onConnected(); }
44

            
45
57
Ssl::ConnectionInfoConstSharedPtr PassthroughSocket::ssl() const {
46
57
  return transport_socket_->ssl();
47
57
}
48

            
49
void PassthroughSocket::configureInitialCongestionWindow(uint64_t bandwidth_bits_per_sec,
50
1
                                                         std::chrono::microseconds rtt) {
51
1
  return transport_socket_->configureInitialCongestionWindow(bandwidth_bits_per_sec, rtt);
52
1
}
53

            
54
} // namespace TransportSockets
55
} // namespace Extensions
56
} // namespace Envoy