Return information about the protocols used by the server
| 8712 | |
| 8713 | // Return information about the protocols used by the server |
| 8714 | TSReturnCode |
| 8715 | TSHttpTxnServerProtocolStackGet(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 | |
| 8734 | const char * |
| 8735 | TSNormalizedProtocolTag(const char *tag) |
no test coverage detected