MCPcopy Create free account
hub / github.com/apache/httpd / ap_find_token

Function ap_find_token

server/util.c:1726–1756  ·  view source on GitHub ↗

find http tokens, see the definition of token from RFC2068 */

Source from the content-addressed store, hash-verified

1724
1725/* find http tokens, see the definition of token from RFC2068 */
1726AP_DECLARE(int) ap_find_token(apr_pool_t *p, const char *line, const char *tok)
1727{
1728 const unsigned char *start_token;
1729 const unsigned char *s;
1730
1731 if (!line)
1732 return 0;
1733
1734 s = (const unsigned char *)line;
1735 for (;;) {
1736 /* find start of token, skip all stop characters */
1737 while (*s && TEST_CHAR(*s, T_HTTP_TOKEN_STOP)) {
1738 ++s;
1739 }
1740 if (!*s) {
1741 return 0;
1742 }
1743 start_token = s;
1744 /* find end of the token */
1745 while (*s && !TEST_CHAR(*s, T_HTTP_TOKEN_STOP)) {
1746 ++s;
1747 }
1748 if (!ap_cstr_casecmpn((const char *)start_token, (const char *)tok,
1749 s - start_token)) {
1750 return 1;
1751 }
1752 if (!*s) {
1753 return 0;
1754 }
1755 }
1756}
1757
1758static const char *find_last_token(apr_pool_t *p, const char *line,
1759 const char *tok)

Callers 8

cache_save_filterFunction · 0.85
ap_set_keepaliveFunction · 0.85
ap_proxy_create_hdrbrgdFunction · 0.85
h2_protocol_proposeFunction · 0.85
h2_push_policy_determineFunction · 0.85
h2_proxy_req_makeFunction · 0.85
core_upgrade_handlerFunction · 0.85

Calls 1

ap_cstr_casecmpnFunction · 0.85

Tested by

no test coverage detected