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

Function TSHttpTxnClientStreamPriorityGet

src/api/InkAPI.cc:6865–6885  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6863}
6864
6865TSReturnCode
6866TSHttpTxnClientStreamPriorityGet(TSHttpTxn txnp, TSHttpPriority *priority)
6867{
6868 static_assert(sizeof(TSHttpPriority) >= sizeof(TSHttp2Priority),
6869 "TSHttpPriorityType is incorrectly smaller than TSHttp2Priority.");
6870 sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
6871 sdk_assert(priority != nullptr);
6872
6873 auto *sm = reinterpret_cast<HttpSM *>(txnp);
6874 auto *stream = dynamic_cast<Http2Stream *>(sm->get_ua_txn());
6875 if (stream == nullptr) {
6876 return TS_ERROR;
6877 }
6878
6879 auto *priority_out = reinterpret_cast<TSHttp2Priority *>(priority);
6880 priority_out->priority_type = HTTP_PRIORITY_TYPE_HTTP_2;
6881 priority_out->stream_dependency = stream->get_transaction_priority_dependence();
6882 priority_out->weight = stream->get_transaction_priority_weight();
6883
6884 return TS_SUCCESS;
6885}
6886
6887TSReturnCode
6888TSAIORead(int fd, off_t offset, char *buf, size_t buffSize, TSCont contp)

Calls 4

sdk_sanity_check_txnFunction · 0.85
get_ua_txnMethod · 0.80

Tested by

no test coverage detected