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

Function TSHttpTxnInfoIntGet

src/api/InkAPI.cc:4239–4272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4237}
4238
4239TSReturnCode
4240TSHttpTxnInfoIntGet(TSHttpTxn txnp, TSHttpTxnInfoKey key, TSMgmtInt *value)
4241{
4242 sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
4243 sdk_assert(sdk_sanity_check_null_ptr((void *)value) == TS_SUCCESS);
4244
4245 HttpSM *s = reinterpret_cast<HttpSM *>(txnp);
4246 HttpCacheSM *c_sm = &(s->get_cache_sm());
4247
4248 switch (key) {
4249 case TS_TXN_INFO_CACHE_HIT_RAM:
4250 *value = (static_cast<TSMgmtInt>(c_sm->is_ram_cache_hit()));
4251 break;
4252 case TS_TXN_INFO_CACHE_COMPRESSED_IN_RAM:
4253 *value = (static_cast<TSMgmtInt>(c_sm->is_compressed_in_ram()));
4254 break;
4255 case TS_TXN_INFO_CACHE_HIT_RWW:
4256 *value = (static_cast<TSMgmtInt>(c_sm->is_readwhilewrite_inprogress()));
4257 break;
4258 case TS_TXN_INFO_CACHE_OPEN_READ_TRIES:
4259 *value = (static_cast<TSMgmtInt>(c_sm->get_open_read_tries()));
4260 break;
4261 case TS_TXN_INFO_CACHE_OPEN_WRITE_TRIES:
4262 *value = (static_cast<TSMgmtInt>(c_sm->get_open_write_tries()));
4263 break;
4264 case TS_TXN_INFO_CACHE_VOLUME:
4265 *value = (static_cast<TSMgmtInt>(c_sm->get_volume_number()));
4266 break;
4267 default:
4268 return TS_ERROR;
4269 }
4270
4271 return TS_SUCCESS;
4272}
4273
4274TSReturnCode
4275TSHttpSsnInfoIntGet(TSHttpSsn ssnp, TSHttpSsnInfoKey key, TSMgmtInt *value, uint64_t sub_key)

Callers 3

InjectCacheInfoHeaderFunction · 0.85
ts_lua_txn_info_getFunction · 0.85

Calls 8

sdk_sanity_check_txnFunction · 0.85
get_open_read_triesMethod · 0.80
get_open_write_triesMethod · 0.80
is_ram_cache_hitMethod · 0.45
is_compressed_in_ramMethod · 0.45
get_volume_numberMethod · 0.45