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

Function TSHttpTxnClientProtocolStackGet

src/api/InkAPI.cc:8673–8691  ·  view source on GitHub ↗

Return information about the protocols used by the client

Source from the content-addressed store, hash-verified

8671
8672// Return information about the protocols used by the client
8673TSReturnCode
8674TSHttpTxnClientProtocolStackGet(TSHttpTxn txnp, int count, const char **result, int *actual)
8675{
8676 sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
8677 sdk_assert(count == 0 || result != nullptr);
8678 HttpSM *sm = reinterpret_cast<HttpSM *>(txnp);
8679 int new_count = 0;
8680 if (sm && count > 0) {
8681 auto mem = static_cast<std::string_view *>(alloca(sizeof(std::string_view) * count));
8682 new_count = sm->populate_client_protocol(mem, count);
8683 for (int i = 0; i < new_count; ++i) {
8684 result[i] = mem[i].data();
8685 }
8686 }
8687 if (actual) {
8688 *actual = new_count;
8689 }
8690 return TS_SUCCESS;
8691}
8692
8693TSReturnCode
8694TSHttpSsnClientProtocolStackGet(TSHttpSsn ssnp, int count, const char **result, int *actual)

Callers 4

proto_stack_cbFunction · 0.85
append_valueMethod · 0.85

Calls 3

sdk_sanity_check_txnFunction · 0.85
dataMethod · 0.45

Tested by 1