| 1282 | } |
| 1283 | |
| 1284 | void |
| 1285 | UnixNetVConnection::free_thread(EThread *t) |
| 1286 | { |
| 1287 | Dbg(dbg_ctl_iocore_net, "Entering UnixNetVConnection::free()"); |
| 1288 | |
| 1289 | ink_release_assert(t == this_ethread()); |
| 1290 | |
| 1291 | // close socket fd |
| 1292 | if (con.sock.is_ok()) { |
| 1293 | release_inbound_connection_tracking(); |
| 1294 | Metrics::Gauge::decrement(net_rsb.connections_currently_open); |
| 1295 | } |
| 1296 | con.close(); |
| 1297 | |
| 1298 | if (is_tunnel_endpoint()) { |
| 1299 | Dbg(dbg_ctl_iocore_net, "Freeing UnixNetVConnection that is tunnel endpoint"); |
| 1300 | |
| 1301 | Metrics::Gauge::decrement(([&]() -> Metrics::Gauge::AtomicType * { |
| 1302 | switch (get_context()) { |
| 1303 | case NET_VCONNECTION_IN: |
| 1304 | return net_rsb.tunnel_current_client_connections_blind_tcp; |
| 1305 | case NET_VCONNECTION_OUT: |
| 1306 | return net_rsb.tunnel_current_server_connections_blind_tcp; |
| 1307 | default: |
| 1308 | ink_release_assert(false); |
| 1309 | } |
| 1310 | })()); |
| 1311 | } |
| 1312 | |
| 1313 | clear(); |
| 1314 | SET_CONTINUATION_HANDLER(this, &UnixNetVConnection::startEvent); |
| 1315 | ink_assert(!con.sock.is_ok()); |
| 1316 | ink_assert(t == this_ethread()); |
| 1317 | |
| 1318 | if (from_accept_thread) { |
| 1319 | netVCAllocator.free(this); |
| 1320 | } else { |
| 1321 | THREAD_FREE(this, netVCAllocator, t); |
| 1322 | } |
| 1323 | } |
| 1324 | |
| 1325 | void |
| 1326 | UnixNetVConnection::apply_options() |
no test coverage detected