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

Function TSHttpTxnServerProtocolStackGet

src/api/InkAPI.cc:8714–8732  ·  view source on GitHub ↗

Return information about the protocols used by the server

Source from the content-addressed store, hash-verified

8712
8713// Return information about the protocols used by the server
8714TSReturnCode
8715TSHttpTxnServerProtocolStackGet(TSHttpTxn txnp, int count, const char **result, int *actual)
8716{
8717 sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
8718 sdk_assert(count == 0 || result != nullptr);
8719 HttpSM *sm = reinterpret_cast<HttpSM *>(txnp);
8720 int new_count = 0;
8721 if (sm && count > 0) {
8722 auto mem = static_cast<std::string_view *>(alloca(sizeof(std::string_view) * count));
8723 new_count = sm->populate_server_protocol(mem, count);
8724 for (int i = 0; i < new_count; ++i) {
8725 result[i] = mem[i].data();
8726 }
8727 }
8728 if (actual) {
8729 *actual = new_count;
8730 }
8731 return TS_SUCCESS;
8732}
8733
8734const char *
8735TSNormalizedProtocolTag(const char *tag)

Calls 3

sdk_sanity_check_txnFunction · 0.85
dataMethod · 0.45

Tested by

no test coverage detected