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

Method getServerState

plugins/esi/esi.cc:459–492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

457}
458
459void
460ContData::getServerState()
461{
462 TSMBuffer bufp;
463 TSMLoc hdr_loc;
464
465 if (cache_txn) {
466 if (intercept_header) {
467 input_type = DATA_TYPE_PACKED_ESI;
468 return;
469 } else if (TSHttpTxnCachedRespGet(txnp, &bufp, &hdr_loc) != TS_SUCCESS) {
470 TSError("[esi][%s] Could not get server response; set input type to RAW_ESI", __FUNCTION__);
471 input_type = DATA_TYPE_RAW_ESI;
472 return;
473 }
474 } else if (TSHttpTxnServerRespGet(txnp, &bufp, &hdr_loc) != TS_SUCCESS) {
475 TSError("[esi][%s] Could not get server response; set input type to RAW_ESI", __FUNCTION__);
476 input_type = DATA_TYPE_RAW_ESI;
477 return;
478 }
479
480 if (checkHeaderValue(bufp, hdr_loc, TS_MIME_FIELD_CONTENT_ENCODING, TS_MIME_LEN_CONTENT_ENCODING, TS_HTTP_VALUE_GZIP,
481 TS_HTTP_LEN_GZIP)) {
482 input_type = DATA_TYPE_GZIPPED_ESI;
483 } else {
484 input_type = DATA_TYPE_RAW_ESI;
485 }
486
487 if (option_info->packed_node_support && !cache_txn && !head_only) {
488 fillPostHeader(bufp, hdr_loc);
489 }
490
491 TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
492}
493
494ContData::~ContData()
495{

Callers 1

addTransformFunction · 0.80

Calls 5

TSHttpTxnCachedRespGetFunction · 0.85
TSHttpTxnServerRespGetFunction · 0.85
checkHeaderValueFunction · 0.85
TSHandleMLocReleaseFunction · 0.85
TSErrorFunction · 0.50

Tested by

no test coverage detected