Lines Matching refs:ranges

40 http_range_coalesce (off_t * const restrict ranges, int n)  in http_range_coalesce()  argument
59 const off_t b = ranges[i]; in http_range_coalesce()
60 const off_t e = ranges[i+1]; in http_range_coalesce()
63 if (b <= ranges[j] ? e < ranges[j]-80 : ranges[j+1] < b-80) in http_range_coalesce()
66 ranges[i] = b <= ranges[j] ? b : ranges[j]; in http_range_coalesce()
67 ranges[i+1] = e >= ranges[j+1] ? e : ranges[j+1]; in http_range_coalesce()
68 memmove(ranges+j, ranges+j+2, (n-j-2)*sizeof(off_t)); in http_range_coalesce()
82 off_t * const restrict ranges) in http_range_parse_next() argument
89 ranges[1] = -1; /* invalid */ in http_range_parse_next()
92 ranges[0] = n; in http_range_parse_next()
97 ranges[1] = len-1; 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()
104 ranges[0] = len > -n ? len + n : 0;/*('n' is negative here)*/ in http_range_parse_next()
105 ranges[1] = len-1; in http_range_parse_next()
114 off_t ranges[RMAX*2]) in http_range_parse()
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()
147 return http_range_coalesce(ranges, n); in http_range_parse()
152 http_range_single (request_st * const r, const off_t ranges[2]) in http_range_single()
161 len += (uint32_t)li_itostrn(cr+len, sizeof(cr)-len, ranges[0]); in http_range_single()
163 len += (uint32_t)li_itostrn(cr+len, sizeof(cr)-len, ranges[1]); in http_range_single()
170 if (ranges[0]) { in http_range_single()
171 chunkqueue_mark_written(cq, ranges[0]); in http_range_single()
172 cq->bytes_out -= ranges[0]; in http_range_single()
173 cq->bytes_in -= ranges[0]; in http_range_single()
175 cq->bytes_in -= complete_length - (ranges[1] + 1); in http_range_single()
178 c->file.length = c->offset + ranges[1] - ranges[0] + 1; in http_range_single()
180 c->mem->used = c->offset + ranges[1] - ranges[0] + 1 + 1; in http_range_single()
189 chunkqueue_mark_written(&tq, ranges[0]); in http_range_single()
190 chunkqueue_steal(cq, &tq, ranges[1] - ranges[0] + 1); in http_range_single()
199 const off_t ranges[RMAX*2], const int n) in http_range_multi()
248 buffer_append_int(tb, ranges[i]); in http_range_multi()
250 buffer_append_int(tb, ranges[i+1]); in http_range_multi()
259 chunkqueue_append_cq_range(cq, cq, ranges[i], in http_range_multi()
260 ranges[i+1] - ranges[i] + 1); in http_range_multi()
307 off_t ranges[RMAX*2]; in http_range_process() local
309 content_length, ranges); in http_range_process()
313 http_range_single(r, ranges); in http_range_process()
317 http_range_multi(r, ranges, n); in http_range_process()