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

Function checkHttpTxnClientAddrGet

src/api/InkAPITest.cc:3306–3334  ·  view source on GitHub ↗

This func is called by us from mytest_handler to test TSHttpTxnClientAddrGet

Source from the content-addressed store, hash-verified

3304
3305// This func is called by us from mytest_handler to test TSHttpTxnClientAddrGet
3306static int
3307checkHttpTxnClientAddrGet(SocketTest *test, void *data)
3308{
3309 uint16_t port;
3310 uint16_t browser_port;
3311 TSHttpTxn txnp = static_cast<TSHttpTxn>(data);
3312 sockaddr const *ptr = TSHttpTxnClientAddrGet(txnp);
3313
3314 browser_port = test->browser->local_port;
3315
3316 if (nullptr == ptr) {
3317 SDK_RPRINT(test->regtest, "TSHttpTxnClientClientAddrGet", "TestCase2", TC_FAIL, "TSHttpTxnClientAddrGet returned 0 pointer.");
3318 test->test_client_remote_port_get = false;
3319 return TS_EVENT_CONTINUE;
3320 }
3321
3322 port = ats_ip_port_host_order(ptr);
3323 Dbg(dbg_ctl_sdk_ut, "Browser port = %x, Txn remote port = %x", browser_port, port);
3324
3325 if (port == browser_port) {
3326 SDK_RPRINT(test->regtest, "TSHttpTxnClientAddrGet", "TestCase1", TC_PASS, "ok");
3327 test->test_client_remote_port_get = true;
3328 } else {
3329 SDK_RPRINT(test->regtest, "TSHttpTxnClientAddrGet", "TestCase1", TC_FAIL,
3330 "Value's Mismatch. From Function: %d Expected Value: %d", port, browser_port);
3331 test->test_client_remote_port_get = false;
3332 }
3333 return TS_EVENT_CONTINUE;
3334}
3335
3336// This func is called by us from mytest_handler to test TSHttpTxnClientReqGet
3337static int

Callers 1

mytest_handlerFunction · 0.85

Calls 3

TSHttpTxnClientAddrGetFunction · 0.85
SDK_RPRINTFunction · 0.85
ats_ip_port_host_orderFunction · 0.85

Tested by

no test coverage detected