MCPcopy Create free account
hub / github.com/apache/trafficserver / make_net_accept_options

Function make_net_accept_options

src/proxy/http/HttpProxyServerMain.cc:123–166  ·  view source on GitHub ↗

Called from InkAPI.cc

Source from the content-addressed store, hash-verified

121
122// Called from InkAPI.cc
123NetProcessor::AcceptOptions
124make_net_accept_options(const HttpProxyPort *port, unsigned nthreads)
125{
126 NetProcessor::AcceptOptions net;
127
128 net.accept_threads = nthreads;
129
130 REC_ReadConfigInteger(net.packet_mark, "proxy.config.net.sock_packet_mark_in");
131 REC_ReadConfigInteger(net.packet_tos, "proxy.config.net.sock_packet_tos_in");
132 REC_ReadConfigInteger(net.recv_bufsize, "proxy.config.net.sock_recv_buffer_size_in");
133 REC_ReadConfigInteger(net.send_bufsize, "proxy.config.net.sock_send_buffer_size_in");
134 REC_ReadConfigInteger(net.sockopt_flags, "proxy.config.net.sock_option_flag_in");
135 REC_ReadConfigInteger(net.defer_accept, "proxy.config.net.defer_accept");
136
137#if TCP_NOTSENT_LOWAT
138 REC_ReadConfigInteger(net.packet_notsent_lowat, "proxy.config.net.sock_notsent_lowat");
139#endif
140
141#ifdef TCP_FASTOPEN
142 REC_ReadConfigInteger(net.tfo_queue_length, "proxy.config.net.sock_option_tfo_queue_size_in");
143#endif
144
145 if (port) {
146 net.f_inbound_transparent = port->m_inbound_transparent_p;
147 net.f_mptcp = port->m_mptcp;
148 net.ip_family = port->m_family;
149 net.local_port = port->m_port;
150 net.f_proxy_protocol = port->m_proxy_protocol;
151 net.f_proxy_protocol_client_src = port->m_proxy_protocol_client_src;
152
153 if (port->m_inbound_ip.isValid()) {
154 net.local_ip = port->m_inbound_ip;
155 } else if (AF_INET6 == port->m_family && HttpConfig::m_master.inbound.has_ip6()) {
156 net.local_ip = HttpConfig::m_master.inbound.ip6().network_order();
157 } else if (AF_INET == port->m_family && HttpConfig::m_master.inbound.has_ip4()) {
158 net.local_ip = HttpConfig::m_master.inbound.ip4().network_order();
159 } else if (AF_UNIX == port->m_family) {
160 net.local_path = port->m_unix_path;
161 net.sockopt_flags &=
162 ~(NetVCOptions::SOCK_OPT_NO_DELAY | NetVCOptions::SOCK_OPT_TCP_FAST_OPEN | NetVCOptions::SOCK_OPT_TCP_NOTSENT_LOWAT);
163 }
164 }
165 return net;
166}
167
168static void
169MakeHttpProxyAcceptor(HttpProxyAcceptor &acceptor, HttpProxyPort &port, unsigned nthreads)

Callers 4

MakeHttpProxyAcceptorFunction · 0.85
TSNetAcceptFunction · 0.85
TSPortDescriptorAcceptFunction · 0.85
TSPluginDescriptorAcceptFunction · 0.85

Calls 6

has_ip6Method · 0.80
network_orderMethod · 0.80
has_ip4Method · 0.80
isValidMethod · 0.45
ip6Method · 0.45
ip4Method · 0.45

Tested by

no test coverage detected