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

Function mime_parse_uint

src/proxy/hdrs/MIME.cc:3199–3225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3197}
3198
3199uint32_t
3200mime_parse_uint(const char *buf, const char *end)
3201{
3202 uint32_t num;
3203
3204 if (!buf || (buf == end)) {
3205 return 0;
3206 }
3207
3208 if (is_digit(*buf)) // fast case
3209 {
3210 num = *buf++ - '0';
3211 while ((buf != end) && is_digit(*buf)) {
3212 num = (num * 10) + (*buf++ - '0');
3213 }
3214 return num;
3215 } else {
3216 num = 0;
3217 while ((buf != end) && ParseRules::is_space(*buf)) {
3218 buf += 1;
3219 }
3220 while ((buf != end) && is_digit(*buf)) {
3221 num = (num * 10) + (*buf++ - '0');
3222 }
3223 return num;
3224 }
3225}
3226
3227int64_t
3228mime_parse_int64(const char *buf, const char *end)

Callers 2

Calls 1

is_digitFunction · 0.85

Tested by

no test coverage detected