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

Function ap_get_token

server/util.c:1687–1722  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1685 */
1686
1687AP_DECLARE(char *) ap_get_token(apr_pool_t *p, const char **accept_line,
1688 int accept_white)
1689{
1690 const char *ptr = *accept_line;
1691 const char *tok_start;
1692 char *token;
1693
1694 /* Find first non-white byte */
1695
1696 while (apr_isspace(*ptr))
1697 ++ptr;
1698
1699 tok_start = ptr;
1700
1701 /* find token end, skipping over quoted strings.
1702 * (comments are already gone).
1703 */
1704
1705 while (*ptr && (accept_white || !apr_isspace(*ptr))
1706 && *ptr != ';' && *ptr != ',') {
1707 if (*ptr++ == '"')
1708 while (*ptr)
1709 if (*ptr++ == '"')
1710 break;
1711 }
1712
1713 token = apr_pstrmemdup(p, tok_start, ptr - tok_start);
1714
1715 /* Advance accept_line pointer to the next non-white byte */
1716
1717 while (apr_isspace(*ptr))
1718 ++ptr;
1719
1720 *accept_line = ptr;
1721 return token;
1722}
1723
1724
1725/* find http tokens, see the definition of token from RFC2068 */

Callers 6

find_conn_headersFunction · 0.85
get_entryFunction · 0.85
do_languages_lineFunction · 0.85
read_type_mapFunction · 0.85
compress_filterFunction · 0.85
deflate_out_filterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected