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

Function parent_proxy_success

src/api/InkAPITest.cc:7237–7267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7235};
7236
7237static int
7238parent_proxy_success(TSCont contp, TSEvent event, void *edata)
7239{
7240 ParentTest *ptest = static_cast<ParentTest *>(TSContDataGet(contp));
7241 TSHttpTxn txnp = static_cast<TSHttpTxn>(edata);
7242
7243 int expected;
7244 int received;
7245 int status;
7246
7247 switch (event) {
7248 case TS_EVENT_HTTP_SEND_RESPONSE_HDR:
7249 expected = get_request_id(txnp);
7250 received = get_response_id(txnp);
7251
7252 if (expected != received) {
7253 status = REGRESSION_TEST_FAILED;
7254 SDK_RPRINT(ptest->regtest, "TSHttpTxnParentProxySet", "TestCase", TC_FAIL, "Expected response ID %d, received %d", expected,
7255 received);
7256 } else {
7257 status = REGRESSION_TEST_PASSED;
7258 SDK_RPRINT(ptest->regtest, "TSHttpTxnParentProxySet", "TestCase", TC_PASS, "Received expected response ID %d", expected);
7259 }
7260 TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
7261 return status;
7262
7263 default:
7264 SDK_RPRINT(ptest->regtest, "TSHttpTxnParentProxySet", ptest->testcase, TC_FAIL, "Unexpected event %d", event);
7265 return REGRESSION_TEST_FAILED;
7266 }
7267}
7268
7269static int
7270parent_proxy_fail(TSCont contp, TSEvent event, void *edata)

Callers

nothing calls this directly

Calls 5

TSContDataGetFunction · 0.85
get_request_idFunction · 0.85
get_response_idFunction · 0.85
SDK_RPRINTFunction · 0.85
TSHttpTxnReenableFunction · 0.85

Tested by

no test coverage detected