| 457 | } |
| 458 | |
| 459 | void |
| 460 | ContData::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 | |
| 494 | ContData::~ContData() |
| 495 | { |
no test coverage detected