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

Method init

src/iocore/net/Socks.cc:53–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51} // end anonymous namespace
52
53void
54SocksEntry::init(Ptr<ProxyMutex> &m, SocksNetVC *vc, unsigned char socks_support, unsigned char ver)
55{
56 mutex = m;
57 buf = new_MIOBuffer(BUFFER_SIZE_INDEX_32K);
58 reader = buf->alloc_reader();
59
60 socks_cmd = socks_support;
61
62 if (ver == SOCKS_DEFAULT_VERSION) {
63 version = netProcessor.socks_conf_stuff->default_version;
64 } else {
65 version = ver;
66 }
67
68 SET_HANDLER(&SocksEntry::startEvent);
69
70 ats_ip_copy(&target_addr, vc->get_remote_addr());
71
72 req_data.hdr = nullptr;
73 req_data.hostname_str = nullptr;
74 req_data.api_info = nullptr;
75 req_data.xact_start = time(nullptr);
76
77 assert(ats_is_ip4(&target_addr));
78 ats_ip_copy(&req_data.dest_ip, &target_addr);
79
80 // we dont have information about the source. set to destination's
81 ats_ip_copy(&req_data.src_ip, &target_addr);
82
83 server_params = SocksServerConfig::acquire();
84
85 nattempts = 0;
86 findServer();
87
88 timeout = this_ethread()->schedule_in(this, HRTIME_SECONDS(netProcessor.socks_conf_stuff->server_connect_timeout));
89 write_done = false;
90}
91
92void
93SocksEntry::findServer()

Callers

nothing calls this directly

Calls 7

ats_ip_copyFunction · 0.85
ats_is_ip4Function · 0.85
acquireFunction · 0.85
this_ethreadFunction · 0.85
alloc_readerMethod · 0.80
get_remote_addrMethod · 0.45
schedule_inMethod · 0.45

Tested by

no test coverage detected