Return information about the protocols used by the client
| 8671 | |
| 8672 | // Return information about the protocols used by the client |
| 8673 | TSReturnCode |
| 8674 | TSHttpTxnClientProtocolStackGet(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 | |
| 8693 | TSReturnCode |
| 8694 | TSHttpSsnClientProtocolStackGet(TSHttpSsn ssnp, int count, const char **result, int *actual) |