Lines Matching refs:r
152 http_range_single (request_st * const r, const off_t ranges[2]) in http_range_single() argument
155 chunkqueue * const restrict cq = &r->write_queue; in http_range_single()
166 http_header_response_set(r, HTTP_HEADER_CONTENT_RANGE, in http_range_single()
198 http_range_multi (request_st * const r, in http_range_multi() argument
211 buffer * const tb = r->tmp_buf; in http_range_multi()
214 http_header_response_get(r, HTTP_HEADER_CONTENT_TYPE, in http_range_multi()
223 http_header_response_set(r, HTTP_HEADER_CONTENT_TYPE, in http_range_multi()
228 chunkqueue * const restrict cq = &r->write_queue; in http_range_multi()
276 http_range_not_satisfiable (request_st * const r, const off_t content_length) in http_range_not_satisfiable() argument
282 http_header_response_set(r, HTTP_HEADER_CONTENT_RANGE, in http_range_not_satisfiable()
284 r->handler_module = NULL; in http_range_not_satisfiable()
285 return (r->http_status = 416); /* Range Not Satisfiable */ in http_range_not_satisfiable()
291 http_range_process (request_st * const r, const buffer * const http_range) in http_range_process() argument
293 const off_t content_length = chunkqueue_length(&r->write_queue); in http_range_process()
295 return r->http_status; /* skip Range handling if empty payload */ in http_range_process()
302 return r->http_status; /* 200 OK */ in http_range_process()
313 http_range_single(r, ranges); in http_range_process()
315 return http_range_not_satisfiable(r, content_length); in http_range_process()
317 http_range_multi(r, ranges, n); in http_range_process()
321 http_header_response_set_ptr(r, HTTP_HEADER_CONTENT_LENGTH, in http_range_process()
323 chunkqueue_length(&r->write_queue)); in http_range_process()
325 return (r->http_status = 206); /* 206 Partial Content */ in http_range_process()
330 http_range_rfc7233 (request_st * const r) in http_range_rfc7233() argument
332 const int http_status = r->http_status; in http_range_rfc7233()
339 if (!r->resp_body_finished) in http_range_rfc7233()
354 if (!http_method_get_or_head(r->http_method)) in http_range_rfc7233()
357 if (r->http_version < HTTP_VERSION_1_1) in http_range_rfc7233()
371 if ((r->resp_htags in http_range_rfc7233()
377 if (light_btst(r->resp_htags, HTTP_HEADER_CONTENT_RANGE)) in http_range_rfc7233()
380 http_header_response_get(r, HTTP_HEADER_CONTENT_TYPE, in http_range_rfc7233()
395 if (!light_btst(r->resp_htags, HTTP_HEADER_ACCEPT_RANGES)) in http_range_rfc7233()
396 http_header_response_set(r, HTTP_HEADER_ACCEPT_RANGES, in http_range_rfc7233()
401 http_header_response_get(r, HTTP_HEADER_ACCEPT_RANGES, in http_range_rfc7233()
415 if (r->http_method != HTTP_METHOD_GET) in http_range_rfc7233()
420 http_header_request_get(r, HTTP_HEADER_RANGE, CONST_STR_LEN("Range")); in http_range_rfc7233()
432 if (light_btst(r->rqst_htags, HTTP_HEADER_IF_RANGE)) { in http_range_rfc7233()
434 http_header_request_get(r, HTTP_HEADER_IF_RANGE, in http_range_rfc7233()
441 ? http_header_response_get(r, HTTP_HEADER_ETAG, in http_range_rfc7233()
443 : http_header_response_get(r, HTTP_HEADER_LAST_MODIFIED, in http_range_rfc7233()
460 http_header_response_unset(r, HTTP_HEADER_ACCEPT_RANGES, in http_range_rfc7233()
465 return http_range_process(r, http_range); in http_range_rfc7233()