| 555 | } |
| 556 | |
| 557 | void |
| 558 | SessionProtocolNameRegistry::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 | |
| 580 | int |
| 581 | HttpProxyPort::print(char *out, size_t n) |
no test coverage detected