Lines Matching refs:cq

27 static void http_chunk_len_append(chunkqueue * const cq, uintmax_t len) {  in http_chunk_len_append()  argument
33 chunkqueue_append_mem(cq, b.ptr, b.used-1); in http_chunk_len_append()
39 chunkqueue_append_mem(cq, buf+i, sizeof(buf)-i); in http_chunk_len_append()
44 static int http_chunk_len_append_tempfile(chunkqueue * const cq, uintmax_t len, log_error_st * cons… in http_chunk_len_append_tempfile() argument
50 return chunkqueue_append_mem_to_tempfile(cq, b.ptr, b.used-1, errh); in http_chunk_len_append_tempfile()
56 return chunkqueue_append_mem_to_tempfile(cq, buf+i, sizeof(buf)-i, errh); in http_chunk_len_append_tempfile()
69 chunkqueue * const cq = &r->write_queue; in http_chunk_append_read_fd_range() local
72 http_chunk_len_append(cq, (uintmax_t)len); in http_chunk_append_read_fd_range()
74 buffer * const b = chunkqueue_append_buffer_open_sz(cq, len+2+1); in http_chunk_append_read_fd_range()
86 chunkqueue_append_buffer_commit(cq); in http_chunk_append_read_fd_range()
92 chunkqueue * const cq = &r->write_queue; in http_chunk_append_file_ref_range() local
100 http_chunk_len_append(cq, (uintmax_t)len); in http_chunk_append_file_ref_range()
104 chunkqueue_append_file_fd(cq, fn, fd, offset, len); in http_chunk_append_file_ref_range()
106 chunk * const d = cq->last; in http_chunk_append_file_ref_range()
113 chunkqueue_append_mem(cq, CONST_STR_LEN("\r\n")); in http_chunk_append_file_ref_range()
118 chunkqueue * const cq = &r->write_queue; in http_chunk_append_file_fd_range() local
121 http_chunk_len_append(cq, (uintmax_t)len); in http_chunk_append_file_fd_range()
123 chunkqueue_append_file_fd(cq, fn, fd, offset, len); in http_chunk_append_file_fd_range()
126 chunkqueue_append_mem(cq, CONST_STR_LEN("\r\n")); in http_chunk_append_file_fd_range()
157 chunkqueue * const cq = &r->write_queue; in http_chunk_append_to_tempfile() local
161 && 0 != http_chunk_len_append_tempfile(cq, len, errh)) in http_chunk_append_to_tempfile()
164 if (0 != chunkqueue_append_mem_to_tempfile(cq, mem, len, errh)) in http_chunk_append_to_tempfile()
169 chunkqueue_append_mem_to_tempfile(cq, CONST_STR_LEN("\r\n"), errh)) in http_chunk_append_to_tempfile()
177 chunkqueue * const cq = &r->write_queue; in http_chunk_append_cq_to_tempfile() local
181 && 0 != http_chunk_len_append_tempfile(cq, len, errh)) in http_chunk_append_cq_to_tempfile()
184 if (0 != chunkqueue_steal_with_tempfiles(cq, src, len, errh)) in http_chunk_append_cq_to_tempfile()
189 chunkqueue_append_mem_to_tempfile(cq, CONST_STR_LEN("\r\n"), errh)) in http_chunk_append_cq_to_tempfile()
197 static int http_chunk_uses_tempfile(const chunkqueue * const cq, const size_t len) { in http_chunk_uses_tempfile() argument
203 const chunk * const c = cq->last; in http_chunk_uses_tempfile()
206 || chunkqueue_length(cq) + len > 65536); in http_chunk_uses_tempfile()
214 chunkqueue * const cq = &r->write_queue; in http_chunk_append_buffer() local
216 if (http_chunk_uses_tempfile(cq, len)) { in http_chunk_append_buffer()
223 http_chunk_len_append(cq, len); in http_chunk_append_buffer()
226 chunkqueue_append_buffer(cq, mem); in http_chunk_append_buffer()
229 chunkqueue_append_mem(cq, CONST_STR_LEN("\r\n")); in http_chunk_append_buffer()
239 chunkqueue * const cq = &r->write_queue; in http_chunk_append_mem() local
241 if (http_chunk_uses_tempfile(cq, len)) in http_chunk_append_mem()
245 http_chunk_len_append(cq, len); in http_chunk_append_mem()
247 chunkqueue_append_mem(cq, mem, len); in http_chunk_append_mem()
250 chunkqueue_append_mem(cq, CONST_STR_LEN("\r\n")); in http_chunk_append_mem()
258 chunkqueue * const cq = &r->write_queue; in http_chunk_transfer_cqlen() local
260 if (http_chunk_uses_tempfile(cq, len)) in http_chunk_transfer_cqlen()
264 http_chunk_len_append(cq, len); in http_chunk_transfer_cqlen()
266 chunkqueue_steal(cq, src, len); in http_chunk_transfer_cqlen()
269 chunkqueue_append_mem(cq, CONST_STR_LEN("\r\n")); in http_chunk_transfer_cqlen()