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

Method has_proxy_protocol

src/iocore/net/NetVConnection.cc:53–68  ·  view source on GitHub ↗

PROXY Protocol check with IOBufferReader If the buffer has PROXY Protocol, it will be consumed by this function. */

Source from the content-addressed store, hash-verified

51 If the buffer has PROXY Protocol, it will be consumed by this function.
52 */
53bool
54NetVConnection::has_proxy_protocol(IOBufferReader *reader)
55{
56 char buf[PPv1_CONNECTION_HEADER_LEN_MAX + 1];
57 swoc::TextView tv;
58 tv.assign(buf, reader->memcpy(buf, sizeof(buf), 0));
59
60 size_t len = proxy_protocol_parse(&this->pp_info, tv);
61
62 if (len > 0) {
63 reader->consume(len);
64 return true;
65 }
66
67 return false;
68}
69
70/**
71 PROXY Protocol check with buffer

Callers 2

read_raw_dataMethod · 0.80
ioCompletionEventMethod · 0.80

Calls 4

proxy_protocol_parseFunction · 0.85
memcpyMethod · 0.80
assignMethod · 0.45
consumeMethod · 0.45

Tested by

no test coverage detected