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

Function txn_error_get

src/api/InkAPI.cc:6753–6777  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6751}
6752
6753static void
6754txn_error_get(TSHttpTxn txnp, bool client, bool sent, uint32_t &error_class, uint64_t &error_code)
6755{
6756 sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
6757 HttpSM *sm = reinterpret_cast<HttpSM *>(txnp);
6758 HttpTransact::ConnectionAttributes *connection_attributes = nullptr;
6759
6760 if (client == true) {
6761 // client
6762 connection_attributes = &sm->t_state.client_info;
6763 } else {
6764 // server
6765 connection_attributes = &sm->t_state.server_info;
6766 }
6767
6768 if (sent == true) {
6769 // sent
6770 error_code = connection_attributes->tx_error_code.code;
6771 error_class = static_cast<uint32_t>(connection_attributes->tx_error_code.cls);
6772 } else {
6773 // received
6774 error_code = connection_attributes->rx_error_code.code;
6775 error_class = static_cast<uint32_t>(connection_attributes->rx_error_code.cls);
6776 }
6777}
6778
6779void
6780TSHttpTxnClientReceivedErrorGet(TSHttpTxn txnp, uint32_t *error_class, uint64_t *error_code)

Calls 1

sdk_sanity_check_txnFunction · 0.85

Tested by

no test coverage detected