This func is called by us from mytest_handler to check for TSHttpTxnClientProtocolStackGet
| 3098 | |
| 3099 | // This func is called by us from mytest_handler to check for TSHttpTxnClientProtocolStackGet |
| 3100 | static int |
| 3101 | checkHttpTxnClientProtocolStackGet(SocketTest *test, void *data) |
| 3102 | { |
| 3103 | TSHttpTxn txnp = static_cast<TSHttpTxn>(data); |
| 3104 | const char *results[10]; |
| 3105 | int count = 0; |
| 3106 | TSHttpTxnClientProtocolStackGet(txnp, 10, results, &count); |
| 3107 | // Should return results[0] = "http/1.0", results[1] = "tcp", results[2] = "ipv4" |
| 3108 | test->test_client_protocol_stack_get = true; |
| 3109 | if (count != 3) { |
| 3110 | test->test_client_protocol_stack_get = false; |
| 3111 | SDK_RPRINT(test->regtest, "TSHttpTxnClientProtocolStackGet", "TestCase1", TC_FAIL, "count should be 3 is %d", count); |
| 3112 | } else if (strcmp(results[0], "http/1.0") != 0) { |
| 3113 | test->test_client_protocol_stack_get = false; |
| 3114 | SDK_RPRINT(test->regtest, "TSHttpTxnClientProtocolStackGet", "TestCase1", TC_FAIL, "results[0] should be http/1.0 is %s", |
| 3115 | results[0]); |
| 3116 | } else if (strcmp(results[1], "tcp") != 0) { |
| 3117 | test->test_client_protocol_stack_get = false; |
| 3118 | SDK_RPRINT(test->regtest, "TSHttpTxnClientProtocolStackGet", "TestCase1", TC_FAIL, "results[1] should be tcp is %s", |
| 3119 | results[1]); |
| 3120 | } else if (strcmp(results[2], "ipv4") != 0) { |
| 3121 | test->test_client_protocol_stack_get = false; |
| 3122 | SDK_RPRINT(test->regtest, "TSHttpTxnClientProtocolStackGet", "TestCase1", TC_FAIL, "results[2] should be ipv4 is %s", |
| 3123 | results[2]); |
| 3124 | } else { |
| 3125 | SDK_RPRINT(test->regtest, "TSHttpTxnClientProtocolStackGet", "TestCase1", TC_PASS, "ok stack_size=%d", count); |
| 3126 | } |
| 3127 | return TS_EVENT_CONTINUE; |
| 3128 | } |
| 3129 | |
| 3130 | // This func is called by us from mytest_handler to check for TSHttpTxnClientProtocolStackContains |
| 3131 | static int |
no test coverage detected