This func is called by us from mytest_handler to test TSHttpTxnClientAddrGet
| 3304 | |
| 3305 | // This func is called by us from mytest_handler to test TSHttpTxnClientAddrGet |
| 3306 | static int |
| 3307 | checkHttpTxnClientAddrGet(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 |
| 3337 | static int |
no test coverage detected