MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / parse_algo_hdr

Function parse_algo_hdr

modules/compression/compression.c:2035–2068  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2033
2034
2035static inline void parse_algo_hdr(struct hdr_field* algo_hdr, int* algo, int* b64_required)
2036{
2037 int rc;
2038 char* delim=NULL;
2039
2040 str tok;
2041 str s_tok;
2042
2043 s_tok.s = algo_hdr->body.s;
2044 s_tok.len = algo_hdr->body.len;
2045
2046 do {
2047 delim = q_memchr(s_tok.s, ATTR_DELIM[0], s_tok.len);
2048
2049 if (delim==NULL) {
2050 trim_spaces_lr(s_tok);
2051 rc = get_algo(&s_tok);
2052 } else {
2053 tok.s = s_tok.s;
2054 tok.len = delim - s_tok.s;
2055
2056 s_tok.s = delim+1;
2057 s_tok.len = (delim-tok.s+1);
2058
2059 trim_spaces_lr(tok);
2060 rc = get_algo(&tok);
2061 }
2062
2063 if (rc < 2 && rc >=0)
2064 *algo = rc;
2065 else
2066 *b64_required = rc;
2067 } while(delim);
2068}

Callers 1

mc_decompressFunction · 0.85

Calls 2

q_memchrFunction · 0.85
get_algoFunction · 0.85

Tested by

no test coverage detected