Lines Matching refs:r

61 static int http_chunk_append_read_fd_range(request_st * const r, const buffer * const fn, const int…  in http_chunk_append_read_fd_range()  argument
69 chunkqueue * const cq = &r->write_queue; in http_chunk_append_read_fd_range()
71 if (r->resp_send_chunked) in http_chunk_append_read_fd_range()
83 if (r->resp_send_chunked) in http_chunk_append_read_fd_range()
91 void http_chunk_append_file_ref_range(request_st * const r, stat_cache_entry * const sce, const off… in http_chunk_append_file_ref_range() argument
92 chunkqueue * const cq = &r->write_queue; in http_chunk_append_file_ref_range()
99 if (r->resp_send_chunked) in http_chunk_append_file_ref_range()
112 if (r->resp_send_chunked) in http_chunk_append_file_ref_range()
117 void http_chunk_append_file_fd_range(request_st * const r, const buffer * const fn, const int fd, c… in http_chunk_append_file_fd_range() argument
118 chunkqueue * const cq = &r->write_queue; in http_chunk_append_file_fd_range()
120 if (r->resp_send_chunked) in http_chunk_append_file_fd_range()
125 if (r->resp_send_chunked) in http_chunk_append_file_fd_range()
129 int http_chunk_append_file_fd(request_st * const r, const buffer * const fn, const int fd, const of… in http_chunk_append_file_fd() argument
130 if (sz > 32768 || !r->resp_send_chunked) { in http_chunk_append_file_fd()
131 http_chunk_append_file_fd_range(r, fn, fd, 0, sz); in http_chunk_append_file_fd()
136 int rc = (0 != sz) ? http_chunk_append_read_fd_range(r,fn,fd,0,sz) : 0; in http_chunk_append_file_fd()
141 int http_chunk_append_file_ref(request_st * const r, stat_cache_entry * const sce) { in http_chunk_append_file_ref() argument
143 if (sz > 32768 || !r->resp_send_chunked) { in http_chunk_append_file_ref()
144 http_chunk_append_file_ref_range(r, sce, 0, sz); in http_chunk_append_file_ref()
151 int rc = (0 != sz) ? http_chunk_append_read_fd_range(r,fn,fd,0,sz) : 0; in http_chunk_append_file_ref()
156 static int http_chunk_append_to_tempfile(request_st * const r, const char * const mem, const size_t… in http_chunk_append_to_tempfile() argument
157 chunkqueue * const cq = &r->write_queue; in http_chunk_append_to_tempfile()
158 log_error_st * const errh = r->conf.errh; in http_chunk_append_to_tempfile()
160 if (r->resp_send_chunked in http_chunk_append_to_tempfile()
167 if (r->resp_send_chunked in http_chunk_append_to_tempfile()
176 static int http_chunk_append_cq_to_tempfile(request_st * const r, chunkqueue * const src, const siz… in http_chunk_append_cq_to_tempfile() argument
177 chunkqueue * const cq = &r->write_queue; in http_chunk_append_cq_to_tempfile()
178 log_error_st * const errh = r->conf.errh; in http_chunk_append_cq_to_tempfile()
180 if (r->resp_send_chunked in http_chunk_append_cq_to_tempfile()
187 if (r->resp_send_chunked in http_chunk_append_cq_to_tempfile()
210 int http_chunk_append_buffer(request_st * const r, buffer * const mem) { in http_chunk_append_buffer() argument
214 chunkqueue * const cq = &r->write_queue; in http_chunk_append_buffer()
217 int rc = http_chunk_append_to_tempfile(r, mem->ptr, len); in http_chunk_append_buffer()
222 if (r->resp_send_chunked) in http_chunk_append_buffer()
228 if (r->resp_send_chunked) in http_chunk_append_buffer()
235 int http_chunk_append_mem(request_st * const r, const char * const mem, const size_t len) { in http_chunk_append_mem() argument
239 chunkqueue * const cq = &r->write_queue; in http_chunk_append_mem()
242 return http_chunk_append_to_tempfile(r, mem, len); in http_chunk_append_mem()
244 if (r->resp_send_chunked) in http_chunk_append_mem()
249 if (r->resp_send_chunked) in http_chunk_append_mem()
255 int http_chunk_transfer_cqlen(request_st * const r, chunkqueue * const src, const size_t len) { in http_chunk_transfer_cqlen() argument
258 chunkqueue * const cq = &r->write_queue; in http_chunk_transfer_cqlen()
261 return http_chunk_append_cq_to_tempfile(r, src, len); in http_chunk_transfer_cqlen()
263 if (r->resp_send_chunked) in http_chunk_transfer_cqlen()
268 if (r->resp_send_chunked) in http_chunk_transfer_cqlen()
274 void http_chunk_close(request_st * const r) { in http_chunk_close() argument
275 if (!r->resp_send_chunked) return; in http_chunk_close()
277 if (r->gw_dechunk) { in http_chunk_close()
278 if (!r->gw_dechunk->done) in http_chunk_close()
279 r->keep_alive = 0; in http_chunk_close()
282 chunkqueue_append_mem(&r->write_queue, CONST_STR_LEN("0\r\n\r\n")); in http_chunk_close()
286 http_chunk_decode_append_data (request_st * const r, const char *mem, off_t len) in http_chunk_decode_append_data() argument
288 if (r->gw_dechunk->done) return -1; /*(excess data)*/ in http_chunk_decode_append_data()
290 buffer * const h = &r->gw_dechunk->b; in http_chunk_decode_append_data()
291 off_t te_chunked = r->gw_dechunk->gw_chunked; in http_chunk_decode_append_data()
304 log_error(r->conf.errh, __FILE__, __LINE__, in http_chunk_decode_append_data()
321 log_error(r->conf.errh, __FILE__, __LINE__, in http_chunk_decode_append_data()
336 log_error(r->conf.errh, __FILE__, __LINE__, in http_chunk_decode_append_data()
346 log_error(r->conf.errh, __FILE__, __LINE__, in http_chunk_decode_append_data()
364 r->gw_dechunk->done = r->http_status; in http_chunk_decode_append_data()
372 mlen = (r->conf.max_request_field_size > mlen) in http_chunk_decode_append_data()
373 ? r->conf.max_request_field_size - mlen in http_chunk_decode_append_data()
378 if (r->resp_send_chunked) r->keep_alive = 0; in http_chunk_decode_append_data()
379 r->gw_dechunk->done = r->http_status; in http_chunk_decode_append_data()
396 r->gw_dechunk->done = r->http_status; in http_chunk_decode_append_data()
414 if (!r->resp_send_chunked in http_chunk_decode_append_data()
415 && 0 != http_chunk_append_mem(r, mem, clen)) in http_chunk_decode_append_data()
444 if (r->gw_dechunk->done) in http_chunk_decode_append_data()
445 r->resp_body_finished = 1; in http_chunk_decode_append_data()
446 r->gw_dechunk->gw_chunked = te_chunked; in http_chunk_decode_append_data()
450 int http_chunk_decode_append_buffer(request_st * const r, buffer * const mem) in http_chunk_decode_append_buffer() argument
461 if (0 != http_chunk_decode_append_data(r, BUF_PTR_LEN(mem))) in http_chunk_decode_append_buffer()
471 if (r->resp_send_chunked) { in http_chunk_decode_append_buffer()
472 r->resp_send_chunked = 0; in http_chunk_decode_append_buffer()
473 int rc = http_chunk_append_buffer(r, mem); /* might append to tmpfile */ in http_chunk_decode_append_buffer()
474 r->resp_send_chunked = 1; in http_chunk_decode_append_buffer()
483 int http_chunk_decode_append_mem(request_st * const r, const char * const mem, size_t len) in http_chunk_decode_append_mem() argument
488 if (0 != http_chunk_decode_append_data(r, mem, (off_t)len)) in http_chunk_decode_append_mem()
496 if (r->resp_send_chunked) { in http_chunk_decode_append_mem()
497 r->resp_send_chunked = 0; in http_chunk_decode_append_mem()
498 int rc = http_chunk_append_mem(r, mem, len); /*might append to tmpfile*/ in http_chunk_decode_append_mem()
499 r->resp_send_chunked = 1; in http_chunk_decode_append_mem()