Lines Matching refs:cq
258 connection_write_chunkqueue (connection * const con, chunkqueue * const restrict cq, off_t max_byte… in connection_write_chunkqueue() argument
267 off_t written = cq->bytes_out; in connection_write_chunkqueue()
281 if (cq->first->next && cq->first->type == MEM_CHUNK) { in connection_write_chunkqueue()
282 const chunk *c = cq->first; in connection_write_chunkqueue()
290 if (NULL != c || (con->is_ssl_sock && chunkqueue_length(cq) > 16384)) { in connection_write_chunkqueue()
301 ret = con->network_write(con, cq, max_bytes); in connection_write_chunkqueue()
303 ret = chunkqueue_is_empty(cq) ? 0 : 1; in connection_write_chunkqueue()
314 written = cq->bytes_out - written; in connection_write_chunkqueue()
330 chunkqueue * const cq = con->write_queue; in connection_write_1xx_info() local
331 off_t written = cq->bytes_out; in connection_write_1xx_info()
333 int rc = con->network_write(con, cq, MAX_WRITE_LIMIT); in connection_write_1xx_info()
335 written = cq->bytes_out - written; in connection_write_1xx_info()
345 if (!chunkqueue_is_empty(cq)) { /* partial write (unlikely) */ in connection_write_1xx_info()
347 if (cq == &r->write_queue) { in connection_write_1xx_info()
353 con->write_queue->bytes_in = cq->bytes_out; /*(yes, bytes_out)*/ in connection_write_1xx_info()
354 con->write_queue->bytes_out = cq->bytes_out; in connection_write_1xx_info()
355 chunkqueue_append_chunkqueue(con->write_queue, cq); in connection_write_1xx_info()
388 chunkqueue * const cq = con->write_queue; /*(bypass r->write_queue)*/ in connection_send_1xx() local
390 buffer * const b = chunkqueue_append_buffer_open(cq); in connection_send_1xx()
402 chunkqueue_append_buffer_commit(cq); in connection_send_1xx()
420 chunkqueue * const cq = con->write_queue; /*(bypass r->write_queue)*/ in connection_write_100_continue() local
421 chunkqueue_append_mem(cq, http_100_continue, sizeof(http_100_continue)-1); in connection_write_100_continue()
565 connection_discard_blank_line (chunkqueue * const cq, uint32_t header_len) in connection_discard_blank_line() argument
568 chunkqueue_mark_written(cq, header_len); in connection_discard_blank_line()
569 return cq->first; /* refresh c after chunkqueue_mark_written() */ in connection_discard_blank_line()
573 static chunk * connection_read_header_more(connection *con, chunkqueue *cq, chunk *c, const size_t … in connection_read_header_more() argument
581 if (0 != con->network_read(con, cq, MAX_READ_LIMIT)) { in connection_read_header_more()
590 if (cq->first != cq->last && 0 != olen) { in connection_read_header_more()
591 const size_t clen = chunkqueue_length(cq); in connection_read_header_more()
594 chunkqueue_compact_mem(cq, block > clen ? clen : block); in connection_read_header_more()
598 c = cq->first; in connection_read_header_more()
641 chunkqueue * const cq = con->read_queue; in connection_handle_read_state() local
642 chunk *c = cq->first; in connection_handle_read_state()
653 if (cq->bytes_in == r->bytes_read_ckpt) { in connection_handle_read_state()
672 chunkqueue_compact_mem_offset(cq); in connection_handle_read_state()
704 c = connection_discard_blank_line(cq, header_len);/*cold*/ in connection_handle_read_state()
723 } while ((c = connection_read_header_more(con, cq, c, clen))); in connection_handle_read_state()
726 if (cq->bytes_in > r->bytes_read_ckpt) { in connection_handle_read_state()
750 r->bytes_read_ckpt = cq->bytes_out; in connection_handle_read_state()
773 chunkqueue_mark_written(cq, r->rqst_header_len); in connection_handle_read_state()
858 static int connection_read_cq(connection *con, chunkqueue *cq, off_t max_bytes) { in connection_read_cq() argument
867 chunk *ckpt = cq->last; in connection_read_cq()
868 char * const mem = chunkqueue_get_memory(cq, &mem_len); in connection_read_cq()
877 chunkqueue_use_memory(cq, ckpt, len > 0 ? len : 0); in connection_read_cq()
896 static int connection_write_cq(connection *con, chunkqueue *cq, off_t max_bytes) { in connection_write_cq() argument
898 return con->srv->network_backend_write(con->fd,cq,max_bytes,r->conf.errh); in connection_write_cq()
1193 chunkqueue * const cq = con->read_queue; in connection_state_machine_h2() local
1194 const off_t mark = cq->bytes_in; in connection_state_machine_h2()
1195 if (0 == con->network_read(con, cq, MAX_READ_LIMIT)) { in connection_state_machine_h2()
1196 if (mark < cq->bytes_in) in connection_state_machine_h2()
1589 connection_handle_read_post_cq_compact (chunkqueue * const cq) in connection_handle_read_post_cq_compact() argument
1593 chunk *c = cq->first; in connection_handle_read_post_cq_compact()
1599 chunkqueue_compact_mem(cq, mlen + blen); in connection_handle_read_post_cq_compact()
1608 connection_handle_read_post_chunked_crlf (chunkqueue * const cq) in connection_handle_read_post_chunked_crlf() argument
1619 if (chunkqueue_is_empty(cq)) return 0; in connection_handle_read_post_chunked_crlf()
1621 c = cq->first; in connection_handle_read_post_chunked_crlf()
1641 connection_handle_read_post_chunked (request_st * const r, chunkqueue * const cq, chunkqueue * cons… in connection_handle_read_post_chunked() argument
1647 off_t len = chunkqueue_length(cq); in connection_handle_read_post_chunked()
1651 chunk *c = cq->first; in connection_handle_read_post_chunked()
1703 c = cq->first; in connection_handle_read_post_chunked()
1706 && connection_handle_read_post_cq_compact(cq)); in connection_handle_read_post_chunked()
1731 chunkqueue_mark_written(cq, (size_t)hsz); in connection_handle_read_post_chunked()
1737 chunkqueue_mark_written(cq, (size_t)hsz); in connection_handle_read_post_chunked()
1738 len = chunkqueue_length(cq); in connection_handle_read_post_chunked()
1763 else if (!connection_handle_read_post_cq_compact(cq)) { in connection_handle_read_post_chunked()
1773 chunkqueue_steal(dst_cq, cq, len); in connection_handle_read_post_chunked()
1775 else if (0 != chunkqueue_steal_with_tempfiles(dst_cq, cq, len, in connection_handle_read_post_chunked()
1781 len = chunkqueue_length(cq); in connection_handle_read_post_chunked()
1787 if (-1 == connection_handle_read_post_chunked_crlf(cq)) { in connection_handle_read_post_chunked()
1793 chunkqueue_mark_written(cq, 2);/*consume \r\n at end of chunk data*/ in connection_handle_read_post_chunked()
1797 } while (!chunkqueue_is_empty(cq)); in connection_handle_read_post_chunked()
1805 connection_handle_read_body_unknown (request_st * const r, chunkqueue * const cq, chunkqueue * cons… in connection_handle_read_body_unknown() argument
1809 chunkqueue_append_chunkqueue(dst_cq, cq); in connection_handle_read_body_unknown()
1858 chunkqueue * const cq = &r->read_queue; in connection_handle_read_post_state() local
1877 switch(con->network_read(con, cq, max_per_read)) { in connection_handle_read_post_state()
1888 chunkqueue_remove_finished_chunks(cq); in connection_handle_read_post_state()
1902 ? connection_handle_read_post_chunked(r, cq, dst_cq) in connection_handle_read_post_state()
1903 : connection_handle_read_body_unknown(r, cq, dst_cq); in connection_handle_read_post_state()
1905 chunkqueue_remove_finished_chunks(cq); in connection_handle_read_post_state()
1911 chunkqueue_steal(dst_cq, cq, len); in connection_handle_read_post_state()
1916 chunkqueue_steal(dst_cq, cq, len); in connection_handle_read_post_state()
1919 chunkqueue_steal_with_tempfiles(dst_cq,cq,len,r->conf.errh)) { in connection_handle_read_post_state()
1923 chunkqueue_remove_finished_chunks(cq); in connection_handle_read_post_state()