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

Method markIn

src/records/RecHttp.cc:557–578  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

555}
556
557void
558SessionProtocolNameRegistry::markIn(const char *value, SessionProtocolSet &sp_set)
559{
560 int n; // # of tokens
561 Tokenizer tokens(" ;|,:");
562
563 n = tokens.Initialize(value);
564
565 for (int i = 0; i < n; ++i) {
566 const char *elt = tokens[i];
567
568 /// Check special cases
569 if (0 == strcasecmp(elt, TS_ALPN_PROTOCOL_GROUP_HTTP)) {
570 sp_set.markIn(HTTP_PROTOCOL_SET);
571 } else if (0 == strcasecmp(elt, TS_ALPN_PROTOCOL_GROUP_HTTP2)) {
572 sp_set.markIn(HTTP2_PROTOCOL_SET);
573 } else { // user defined - register and mark.
574 int idx = globalSessionProtocolNameRegistry.toIndex(TextView{elt, strlen(elt)});
575 sp_set.markIn(idx);
576 }
577 }
578}
579
580int
581HttpProxyPort::print(char *out, size_t n)

Calls 3

strcasecmpFunction · 0.85
toIndexMethod · 0.80
InitializeMethod · 0.45

Tested by

no test coverage detected