| 7267 | } |
| 7268 | |
| 7269 | static int |
| 7270 | parent_proxy_fail(TSCont contp, TSEvent event, void *edata) |
| 7271 | { |
| 7272 | ParentTest *ptest = static_cast<ParentTest *>(TSContDataGet(contp)); |
| 7273 | TSHttpTxn txnp = static_cast<TSHttpTxn>(edata); |
| 7274 | |
| 7275 | TSMBuffer mbuf; |
| 7276 | TSMLoc hdr; |
| 7277 | TSHttpStatus expected = TS_HTTP_STATUS_BAD_GATEWAY; |
| 7278 | TSHttpStatus received; |
| 7279 | int status; |
| 7280 | |
| 7281 | switch (event) { |
| 7282 | case TS_EVENT_HTTP_SEND_RESPONSE_HDR: |
| 7283 | ink_release_assert(TSHttpTxnClientRespGet(txnp, &mbuf, &hdr) == TS_SUCCESS); |
| 7284 | received = TSHttpHdrStatusGet(mbuf, hdr); |
| 7285 | |
| 7286 | if (expected != received) { |
| 7287 | status = REGRESSION_TEST_FAILED; |
| 7288 | SDK_RPRINT(ptest->regtest, "TSHttpTxnParentProxySet", "TestCase", TC_FAIL, "Expected response status %d, received %d", |
| 7289 | expected, received); |
| 7290 | } else { |
| 7291 | status = REGRESSION_TEST_PASSED; |
| 7292 | SDK_RPRINT(ptest->regtest, "TSHttpTxnParentProxySet", "TestCase", TC_PASS, "Received expected response status %d", expected); |
| 7293 | } |
| 7294 | |
| 7295 | TSHandleMLocRelease(mbuf, TS_NULL_MLOC, hdr); |
| 7296 | return status; |
| 7297 | |
| 7298 | default: |
| 7299 | SDK_RPRINT(ptest->regtest, "TSHttpTxnParentProxySet", ptest->testcase, TC_FAIL, "Unexpected event %d", event); |
| 7300 | return REGRESSION_TEST_FAILED; |
| 7301 | } |
| 7302 | } |
| 7303 | |
| 7304 | static int |
| 7305 | parent_proxy_handler(TSCont contp, TSEvent event, void *edata) |
nothing calls this directly
no test coverage detected