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

Function checkHttpTxnClientProtocolStackGet

src/api/InkAPITest.cc:3100–3128  ·  view source on GitHub ↗

This func is called by us from mytest_handler to check for TSHttpTxnClientProtocolStackGet

Source from the content-addressed store, hash-verified

3098
3099// This func is called by us from mytest_handler to check for TSHttpTxnClientProtocolStackGet
3100static int
3101checkHttpTxnClientProtocolStackGet(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
3131static int

Callers 1

mytest_handlerFunction · 0.85

Calls 3

SDK_RPRINTFunction · 0.85
strcmpFunction · 0.85

Tested by

no test coverage detected