This func is called by us from mytest_handler to test TSHttpTxnServerIPGet
| 3241 | |
| 3242 | // This func is called by us from mytest_handler to test TSHttpTxnServerIPGet |
| 3243 | static int |
| 3244 | checkHttpTxnServerIPGet(SocketTest *test, void *data) |
| 3245 | { |
| 3246 | sockaddr const *ptr; |
| 3247 | in_addr_t ip; |
| 3248 | TSHttpTxn txnp = static_cast<TSHttpTxn>(data); |
| 3249 | in_addr_t actual_ip = htonl(INADDR_LOOPBACK); /* 127.0.0.1 is expected because the client is on the same machine */ |
| 3250 | |
| 3251 | ptr = TSHttpTxnServerAddrGet(txnp); |
| 3252 | if (nullptr == ptr || 0 == (ip = ats_ip4_addr_cast(ptr))) { |
| 3253 | test->test_server_ip_get = false; |
| 3254 | SDK_RPRINT(test->regtest, "TSHttpTxnServerIPGet", "TestCase1", TC_FAIL, "TSHttpTxnServerIPGet returns 0 %s", |
| 3255 | ptr ? "address" : "pointer"); |
| 3256 | return TS_EVENT_CONTINUE; |
| 3257 | } |
| 3258 | |
| 3259 | if (ip == actual_ip) { |
| 3260 | test->test_server_ip_get = true; |
| 3261 | SDK_RPRINT(test->regtest, "TSHttpTxnServerIPGet", "TestCase1", TC_PASS, "ok"); |
| 3262 | } else { |
| 3263 | test->test_server_ip_get = false; |
| 3264 | SDK_RPRINT(test->regtest, "TSHttpTxnServerIPGet", "TestCase1", TC_FAIL, "Value's Mismatch"); |
| 3265 | } |
| 3266 | |
| 3267 | return TS_EVENT_CONTINUE; |
| 3268 | } |
| 3269 | |
| 3270 | // This func is called by us from mytest_handler to test TSHttpTxnIncomingAddrGet |
| 3271 | static int |
no test coverage detected