Called from InkAPI.cc
| 121 | |
| 122 | // Called from InkAPI.cc |
| 123 | NetProcessor::AcceptOptions |
| 124 | make_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 | |
| 168 | static void |
| 169 | MakeHttpProxyAcceptor(HttpProxyAcceptor &acceptor, HttpProxyPort &port, unsigned nthreads) |
no test coverage detected