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

Method free_thread

src/iocore/net/SSLNetVConnection.cc:985–1044  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

983 super::clear();
984}
985void
986SSLNetVConnection::free_thread(EThread *t)
987{
988 ink_release_assert(t == this_ethread());
989
990 // close socket fd
991 if (con.sock.is_ok()) {
992 release_inbound_connection_tracking();
993 Metrics::Gauge::decrement(net_rsb.connections_currently_open);
994 }
995 con.close();
996
997 if (is_tunnel_endpoint()) {
998 ink_assert(get_context() != NET_VCONNECTION_UNSET);
999
1000 Metrics::Gauge::decrement(([&]() -> Metrics::Gauge::AtomicType * {
1001 if (get_context() == NET_VCONNECTION_IN) {
1002 switch (get_tunnel_type()) {
1003 case SNIRoutingType::BLIND:
1004 return net_rsb.tunnel_current_client_connections_tls_tunnel;
1005 case SNIRoutingType::FORWARD:
1006 return net_rsb.tunnel_current_client_connections_tls_forward;
1007 case SNIRoutingType::PARTIAL_BLIND:
1008 return net_rsb.tunnel_current_client_connections_tls_partial_blind;
1009 default:
1010 return net_rsb.tunnel_current_client_connections_tls_http;
1011 }
1012 }
1013 // NET_VCONNECTION_OUT - Never a tunnel type for out (to server) context.
1014 ink_assert(get_tunnel_type() == SNIRoutingType::NONE);
1015
1016 return net_rsb.tunnel_current_server_connections_tls;
1017 })());
1018 }
1019
1020#if TS_HAS_TLS_EARLY_DATA
1021 if (_early_data_reader != nullptr) {
1022 _early_data_reader->dealloc();
1023 }
1024
1025 if (_early_data_buf != nullptr) {
1026 free_MIOBuffer(_early_data_buf);
1027 }
1028
1029 _early_data_reader = nullptr;
1030 _early_data_buf = nullptr;
1031#endif
1032
1033 clear();
1034 SET_CONTINUATION_HANDLER(this, &SSLNetVConnection::startEvent);
1035 ink_assert(!con.sock.is_ok());
1036 ink_assert(t == this_ethread());
1037
1038 if (from_accept_thread) {
1039 sslNetVCAllocator.free(this);
1040 } else {
1041 ink_assert(!con.sock.is_ok());
1042 THREAD_FREE(this, sslNetVCAllocator, t);

Callers 2

free_neteventMethod · 0.45
connect_reMethod · 0.45

Calls 7

this_ethreadFunction · 0.85
free_MIOBufferFunction · 0.85
clearFunction · 0.50
is_okMethod · 0.45
closeMethod · 0.45
deallocMethod · 0.45
freeMethod · 0.45

Tested by

no test coverage detected