This func is called by us from mytest_handler to test TSHttpTxnIncomingAddrGet
| 3269 | |
| 3270 | // This func is called by us from mytest_handler to test TSHttpTxnIncomingAddrGet |
| 3271 | static int |
| 3272 | checkHttpTxnIncomingAddrGet(SocketTest *test, void *data) |
| 3273 | { |
| 3274 | uint16_t port; |
| 3275 | const HttpProxyPort *proxy_port = HttpProxyPort::findHttp(AF_INET); |
| 3276 | TSHttpTxn txnp = static_cast<TSHttpTxn>(data); |
| 3277 | sockaddr const *ptr = TSHttpTxnIncomingAddrGet(txnp); |
| 3278 | |
| 3279 | if (nullptr == proxy_port) { |
| 3280 | SDK_RPRINT(test->regtest, "TSHttpTxnIncomingPortGet", "TestCase1", TC_FAIL, |
| 3281 | "TSHttpTxnIncomingAddrGet failed to find configured HTTP port."); |
| 3282 | test->test_client_incoming_port_get = false; |
| 3283 | return TS_EVENT_CONTINUE; |
| 3284 | } |
| 3285 | if (nullptr == ptr) { |
| 3286 | SDK_RPRINT(test->regtest, "TSHttpTxnIncomingPortGet", "TestCase1", TC_FAIL, "TSHttpTxnIncomingAddrGet returns 0 pointer"); |
| 3287 | test->test_client_incoming_port_get = false; |
| 3288 | return TS_EVENT_CONTINUE; |
| 3289 | } |
| 3290 | port = ats_ip_port_host_order(ptr); |
| 3291 | |
| 3292 | Dbg(dbg_ctl_sdk_ut, "TS HTTP port = %x, Txn incoming client port %x", proxy_port->m_port, port); |
| 3293 | |
| 3294 | if (port == proxy_port->m_port) { |
| 3295 | SDK_RPRINT(test->regtest, "TSHttpTxnIncomingAddrGet", "TestCase1", TC_PASS, "ok"); |
| 3296 | test->test_client_incoming_port_get = true; |
| 3297 | } else { |
| 3298 | SDK_RPRINT(test->regtest, "TSHttpTxnIncomingAddrGet", "TestCase1", TC_FAIL, |
| 3299 | "Value's Mismatch. From Function: %d Expected value: %d", port, proxy_port->m_port); |
| 3300 | test->test_client_incoming_port_get = false; |
| 3301 | } |
| 3302 | return TS_EVENT_CONTINUE; |
| 3303 | } |
| 3304 | |
| 3305 | // This func is called by us from mytest_handler to test TSHttpTxnClientAddrGet |
| 3306 | static int |
no test coverage detected