| 5607 | } |
| 5608 | |
| 5609 | TSVConn |
| 5610 | TSHttpConnectTransparent(sockaddr const *client_addr, sockaddr const *server_addr) |
| 5611 | { |
| 5612 | sdk_assert(ats_is_ip(client_addr)); |
| 5613 | sdk_assert(ats_is_ip(server_addr)); |
| 5614 | sdk_assert(!ats_is_ip_any(client_addr)); |
| 5615 | sdk_assert(ats_ip_port_cast(client_addr)); |
| 5616 | sdk_assert(!ats_is_ip_any(server_addr)); |
| 5617 | sdk_assert(ats_ip_port_cast(server_addr)); |
| 5618 | |
| 5619 | if (plugin_http_transparent_accept) { |
| 5620 | PluginVCCore *new_pvc = PluginVCCore::alloc(plugin_http_transparent_accept); |
| 5621 | |
| 5622 | // set active address expects host ordering and the above casts do not |
| 5623 | // swap when it is required |
| 5624 | new_pvc->set_active_addr(client_addr); |
| 5625 | new_pvc->set_passive_addr(server_addr); |
| 5626 | new_pvc->set_transparent(true, true); |
| 5627 | |
| 5628 | PluginVC *return_vc = new_pvc->connect(); |
| 5629 | |
| 5630 | if (return_vc != nullptr) { |
| 5631 | PluginVC *other_side = return_vc->get_other_side(); |
| 5632 | |
| 5633 | if (other_side != nullptr) { |
| 5634 | other_side->set_is_internal_request(true); |
| 5635 | } |
| 5636 | } |
| 5637 | |
| 5638 | return reinterpret_cast<TSVConn>(return_vc); |
| 5639 | } |
| 5640 | |
| 5641 | return nullptr; |
| 5642 | } |
| 5643 | |
| 5644 | /* Actions */ |
| 5645 | void |
nothing calls this directly
no test coverage detected