Lines Matching refs:n

40 http_range_coalesce (off_t * const restrict ranges, int n)  in http_range_coalesce()  argument
58 for (int i = 0; i+2 < n; i += 2) { in http_range_coalesce()
61 for (int j = i+2; j < n; j += 2) { in http_range_coalesce()
68 memmove(ranges+j, ranges+j+2, (n-j-2)*sizeof(off_t)); in http_range_coalesce()
70 n -= 2; in http_range_coalesce()
76 return n; in http_range_coalesce()
88 off_t n = strtoll(s, &e, 10); in http_range_parse_next() local
90 if (n >= 0) { in http_range_parse_next()
91 if (n != LLONG_MAX && n < len && s != e) { in http_range_parse_next()
92 ranges[0] = n; in http_range_parse_next()
95 n = strtoll((s = e+1), &e, 10); in http_range_parse_next()
96 if (s == e || (n == 0 && e[-1] != '0')) in http_range_parse_next()
98 else if (ranges[0] <= n && n != LLONG_MAX) in http_range_parse_next()
99 ranges[1] = n < len ? n : len-1; in http_range_parse_next()
103 else if (n != LLONG_MIN) { in http_range_parse_next()
104 ranges[0] = len > -n ? len + n : 0;/*('n' is negative here)*/ in http_range_parse_next()
132 int n = 0; in http_range_parse() local
134 s = http_range_parse_next(s, content_length, ranges+n); in http_range_parse()
135 if ((*s == '\0' || *s == ',') && ranges[n+1] != -1) in http_range_parse()
136 n += 2; in http_range_parse()
139 } while (*s++ != '\0' && n < RMAX*2); in http_range_parse()
142 if (n <= 2) in http_range_parse()
143 return n; in http_range_parse()
147 return http_range_coalesce(ranges, n); in http_range_parse()
199 const off_t ranges[RMAX*2], const int n) in http_range_multi() argument
245 for (int i = 0; i < n; i += 2) { in http_range_multi()
308 const int n = http_range_parse(http_range->ptr+sizeof("bytes=")-1, in http_range_process() local
312 if (2 == n) /* single range */ in http_range_process()
314 else if (0 == n) /* 416 Range Not Satisfiable */ in http_range_process()
317 http_range_multi(r, ranges, n); in http_range_process()