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

Function TSHttpSsnClientProtocolStackGet

src/api/InkAPI.cc:8693–8711  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8691}
8692
8693TSReturnCode
8694TSHttpSsnClientProtocolStackGet(TSHttpSsn ssnp, int count, const char **result, int *actual)
8695{
8696 sdk_assert(sdk_sanity_check_http_ssn(ssnp) == TS_SUCCESS);
8697 sdk_assert(count == 0 || result != nullptr);
8698 auto const *cs = reinterpret_cast<ProxySession *>(ssnp);
8699 int new_count = 0;
8700 if (cs && count > 0) {
8701 auto mem = static_cast<std::string_view *>(alloca(sizeof(std::string_view) * count));
8702 new_count = cs->populate_protocol(mem, count);
8703 for (int i = 0; i < new_count; ++i) {
8704 result[i] = mem[i].data();
8705 }
8706 }
8707 if (actual) {
8708 *actual = new_count;
8709 }
8710 return TS_SUCCESS;
8711}
8712
8713// Return information about the protocols used by the server
8714TSReturnCode

Callers 2

protocol_stackMethod · 0.85

Calls 3

populate_protocolMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected