| /lighttpd1.4/src/ |
| H A D | chunk.h | 73 chunkqueue *chunkqueue_init(chunkqueue *cq); 101 buffer * chunkqueue_prepend_buffer_open(chunkqueue *cq); 103 void chunkqueue_prepend_buffer_commit(chunkqueue *cq); 109 buffer * chunkqueue_append_buffer_open(chunkqueue *cq); 111 void chunkqueue_append_buffer_commit(chunkqueue *cq); 146 void chunkqueue_remove_empty_chunks(chunkqueue *cq); 154 void chunkqueue_compact_mem_offset(chunkqueue *cq); 171 return cq->bytes_in - cq->bytes_out; in chunkqueue_length() 175 void chunkqueue_free(chunkqueue *cq); 177 void chunkqueue_reset(chunkqueue *cq); [all …]
|
| H A D | chunk.c | 96 cq = ck_calloc(1, sizeof(*cq)); in chunkqueue_init() 106 return cq; in chunkqueue_init() 453 if (NULL == (c->next = cq->first)) cq->last = c; in chunkqueue_prepend_chunk() 459 *(cq->last ? &cq->last->next : &cq->first) = c; in chunkqueue_append_chunk() 592 cq->bytes_in += buffer_clen(cq->first->mem); in chunkqueue_prepend_buffer_commit() 608 cq->bytes_in += buffer_clen(cq->last->mem); in chunkqueue_append_buffer_commit() 762 if (cq->tempdirs && cq->tempdirs->used) { in chunkqueue_get_append_newtempfile() 764 for (errno = EIO; cq->tempdir_idx < cq->tempdirs->used; ++cq->tempdir_idx) { in chunkqueue_get_append_newtempfile() 1262 cq->first = cq->last = NULL; in chunkqueue_mark_written() 1280 if (empty == cq->last) cq->last = c; in chunkqueue_remove_empty_chunks() [all …]
|
| H A D | network_write.c | 118 chunkqueue_remove_finished_chunks(cq); in network_remove_finished_chunks() 135 chunkqueue_mark_written(cq, wr); in network_write_accounting() 150 chunk* const c = cq->first; in network_write_mem_chunk() 165 chunk* const c = cq->first; in network_write_file_chunk_no_mmap() 200 chunk * const restrict c = cq->first; in network_write_file_chunk_mmap() 296 chunk * const c = cq->first; in network_write_file_chunk_sendfile() 382 chunkqueue_mark_written(cq, written); in network_write_file_chunk_sendfile() 407 while (NULL != cq->first) { in network_write_chunkqueue_writev() 410 switch (cq->first->type) { in network_write_chunkqueue_writev() 435 while (NULL != cq->first) { in network_write_chunkqueue_sendfile() [all …]
|
| H A D | http_chunk.c | 33 chunkqueue_append_mem(cq, b.ptr, b.used-1); in http_chunk_len_append() 69 chunkqueue * const cq = &r->write_queue; in http_chunk_append_read_fd_range() local 86 chunkqueue_append_buffer_commit(cq); in http_chunk_append_read_fd_range() 106 chunk * const d = cq->last; in http_chunk_append_file_ref_range() 203 const chunk * const c = cq->last; in http_chunk_uses_tempfile() 223 http_chunk_len_append(cq, len); in http_chunk_append_buffer() 226 chunkqueue_append_buffer(cq, mem); in http_chunk_append_buffer() 245 http_chunk_len_append(cq, len); in http_chunk_append_mem() 247 chunkqueue_append_mem(cq, mem, len); in http_chunk_append_mem() 264 http_chunk_len_append(cq, len); in http_chunk_transfer_cqlen() [all …]
|
| H A D | http_range.c | 168 if (cq->first == cq->last) { /* single chunk in cq */ in http_range_single() 172 cq->bytes_out -= ranges[0]; in http_range_single() 173 cq->bytes_in -= ranges[0]; in http_range_single() 176 chunk * const c = cq->first; in http_range_single() 187 cq->bytes_out -= complete_length; in http_range_single() 188 cq->bytes_in -= complete_length; in http_range_single() 242 chunk * const c = (cq->first == cq->last && cq->first->type == MEM_CHUNK) in http_range_multi() 243 ? cq->first in http_range_multi() 259 chunkqueue_append_cq_range(cq, cq, ranges[i], in http_range_multi() 269 cq->bytes_out -= complete_length+2; in http_range_multi() [all …]
|
| H A D | mod_echo.c | 34 chunkqueue * const cq = &r->reqbody_queue; in mod_echo_request_body() local 35 chunkqueue_remove_finished_chunks(cq); /* unnecessary? */ in mod_echo_request_body() 36 off_t cqlen = chunkqueue_length(cq); in mod_echo_request_body() 54 if (cq->bytes_out == (off_t)r->reqbody_length) { in mod_echo_request_body() 60 cqlen = chunkqueue_length(cq); in mod_echo_request_body() 77 chunkqueue * const cq = &r->reqbody_queue; in SUBREQUEST_FUNC() local 78 if (cq->bytes_in != (off_t)r->reqbody_length) { in SUBREQUEST_FUNC() 81 if (chunkqueue_length(cq) > 65536 - 4096 in SUBREQUEST_FUNC() 107 chunkqueue * const cq = &r->reqbody_queue; in SUBREQUEST_FUNC() local 108 if (0 != http_chunk_transfer_cqlen(r, cq, chunkqueue_length(cq))) in SUBREQUEST_FUNC() [all …]
|
| H A D | connections.c | 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() 331 off_t written = cq->bytes_out; in connection_write_1xx_info() 590 if (cq->first != cq->last && 0 != olen) { in connection_read_header_more() 598 c = cq->first; in connection_read_header_more() 642 chunk *c = cq->first; in connection_handle_read_state() 867 chunk *ckpt = cq->last; in connection_read_cq() 1593 chunk *c = cq->first; in connection_handle_read_post_cq_compact() 1621 c = cq->first; in connection_handle_read_post_chunked_crlf() [all …]
|
| H A D | h2.c | 1200 chunkqueue_compact_mem(cq, len); in h2_frame_cq_compact() 1201 return buffer_clen(cq->first->mem) - (uint32_t)cq->first->offset; in h2_frame_cq_compact() 1209 chunk *c = cq->first; in h2_recv_continuation() 1295 cq->bytes_out += plen; in h2_recv_continuation() 1319 cq->bytes_out += 9; in h2_recv_continuation() 1719 chunk *c = cq->first; in h2_parse_frames() 1861 chunk *c = cq->first; in h2_want_read() 1897 if (chunkqueue_length(cq) < 24) { in h2_recv_client_connection_preface() 1898 chunk * const c = cq->first; in h2_recv_client_connection_preface() 1910 chunk *c = cq->first; in h2_recv_client_connection_preface() [all …]
|
| H A D | mod_ssi.c | 679 chunkqueue * const cq = &p->wq; in process_ssi_stmt() local 778 chunkqueue_append_mem(cq, BUF_PTR_LEN(tb)); in process_ssi_stmt() 791 chunkqueue_append_mem(cq, BUF_PTR_LEN(tb)); in process_ssi_stmt() 985 chunkqueue_append_mem(cq, BUF_PTR_LEN(tb)); in process_ssi_stmt() 1126 chunkqueue_append_mem(cq, BUF_PTR_LEN(tb)); in process_ssi_stmt() 1158 c = cq->last; in process_ssi_stmt() 1188 chunkqueue_update_file(cq, c, stb.st_size); in process_ssi_stmt() 1464 chunkqueue * const cq = &p->wq; in mod_ssi_read_fd() local 1530 if (cq->last && cq->last->type == MEM_CHUNK in mod_ssi_read_fd() 1532 if (0 != http_chunk_transfer_cqlen(r, cq, chunkqueue_length(cq))) in mod_ssi_read_fd() [all …]
|
| H A D | mod_cgi.c | 488 chunkqueue *cq = &r->reqbody_queue; in cgi_process_wr_revents() local 489 chunkqueue_mark_written(cq, chunkqueue_length(cq)); in cgi_process_wr_revents() 671 chunkqueue *cq = &r->reqbody_queue; in cgi_write_request() local 679 for (c = cq->first; c; c = cq->first) { in cgi_write_request() 683 chunkqueue_mark_written(cq, wr); in cgi_write_request() 686 if (c != cq->first || wr == 16384) in cgi_write_request() 702 chunkqueue_mark_written(cq, chunkqueue_length(cq)); in cgi_write_request() 726 off_t cqlen = chunkqueue_length(cq); in cgi_write_request() 781 chunk * const c = cq->first; in cgi_create_env() 948 chunkqueue_mark_written(cq, chunkqueue_length(cq)); in cgi_create_env() [all …]
|
| H A D | mod_dirlisting.c | 846 chunkqueue * const cq = &r->write_queue; in http_list_directory_header() local 907 chunkqueue_append_buffer_commit(cq); in http_list_directory_header() 941 chunkqueue_append_buffer_commit(cq); in http_list_directory_header() 946 chunkqueue * const cq = &r->write_queue; in http_list_directory_footer() local 947 chunkqueue_append_mem(cq, CONST_STR_LEN( in http_list_directory_footer() 983 chunkqueue_append_buffer_commit(cq); in http_list_directory_footer() 1150 chunkqueue * const cq = &r->write_queue; in http_list_directory() local 1154 ? chunkqueue_append_buffer_open(cq) in http_list_directory() 1241 chunkqueue_append_buffer_commit(cq); in http_list_directory() 1531 cq->bytes_in -= in.bytes_in; in mod_dirlisting_write_cq() [all …]
|
| H A D | mod_webdav.c | 3851 chunk *c = cq->first; in webdav_parse_chunkqueue() 4533 cq->first = c->next; in mod_webdav_write_single_file_chunk() 4543 cq->first = cq->last = c; in mod_webdav_write_single_file_chunk() 4548 c->next = cq->first; in mod_webdav_write_single_file_chunk() 4549 cq->first = c; in mod_webdav_write_single_file_chunk() 4678 chunkqueue_reset(cq); in mod_webdav_put_prep() 4685 cq->bytes_in = 0; in mod_webdav_put_prep() 4690 force_assert(cq->last); in mod_webdav_put_prep() 4707 chunk *c = cq->first; in mod_webdav_put_linkat_rename() 4825 chunk *c = cq->first; in mod_webdav_put_range() [all …]
|
| H A D | base.h | 41 int (* network_write)(struct connection *con, chunkqueue *cq, off_t max_bytes); 42 int (* network_read)(struct connection *con, chunkqueue *cq, off_t max_bytes); 148 int (* network_backend_write)(int fd, chunkqueue *cq, off_t max_bytes, log_error_st *errh);
|
| H A D | mod_wstunnel.c | 669 chunkqueue *cq = &r->reqbody_queue; in get_key3() local 673 return chunkqueue_read_data(cq, buf, bytes, r->conf.errh); in get_key3() 858 chunkqueue *cq = &r->reqbody_queue; in mod_wstunnel_handshake_create_response() local 859 if (chunkqueue_length(cq) < 8) in mod_wstunnel_handshake_create_response() 935 chunkqueue *cq = &r->reqbody_queue; in recv_ietf_00() local 939 r->con->fd, (long long)chunkqueue_length(cq)); in recv_ietf_00() 940 for (chunk *c = cq->first; c; c = c->next) { in recv_ietf_00() 1027 chunkqueue_mark_written(cq, chunkqueue_length(cq)); in recv_ietf_00() 1123 chunkqueue *cq = &r->reqbody_queue; in recv_rfc_6455() local 1127 for (chunk *c = cq->first; c; c = c->next) { in recv_rfc_6455() [all …]
|
| H A D | response.c | 76 chunkqueue * const cq = con->write_queue; in http_response_write_header_partial_1xx() local 80 uint32_t len = (uint32_t)chunkqueue_length(cq); in http_response_write_header_partial_1xx() 82 if (chunkqueue_read_data(cq, buffer_string_prepare_append(b, len), in http_response_write_header_partial_1xx() 86 chunkqueue_free(cq); in http_response_write_header_partial_1xx() 124 chunkqueue * const cq = &r->write_queue; in http_response_write_header() local 125 buffer * const b = chunkqueue_prepend_buffer_open(cq); in http_response_write_header() 127 if (cq != r->con->write_queue) in http_response_write_header() 183 chunkqueue_prepend_buffer_commit(cq); in http_response_write_header() 189 && (cqlen = chunkqueue_length(cq) - r->resp_header_len) > 0 in http_response_write_header() 191 chunkqueue_small_resp_optim(cq); in http_response_write_header()
|
| H A D | mod_deflate.c | 1518 chunkqueue * const cq = &hctx->r->write_queue; in mod_deflate_using_libdeflate() local 1519 if (cq->tempdirs && cq->tempdir_idx < cq->tempdirs->used) { in mod_deflate_using_libdeflate() 1520 data_string *ds =(data_string *)cq->tempdirs->data[cq->tempdir_idx]; in mod_deflate_using_libdeflate() 1585 chunkqueue_reset(cq); in mod_deflate_using_libdeflate() 1587 cq->last->file.is_temp = 1; in mod_deflate_using_libdeflate() 1695 chunkqueue * const cq = &r->write_queue; in deflate_compress_response() local 1696 len = chunkqueue_length(cq); in deflate_compress_response() 1697 chunkqueue_remove_finished_chunks(cq); in deflate_compress_response() 1698 chunkqueue_append_chunkqueue(&hctx->in_queue, cq); in deflate_compress_response() 1699 cq->bytes_in -= len; in deflate_compress_response() [all …]
|
| H A D | mod_magnet.c | 2305 chunkqueue * const cq = &r->write_queue; in magnet_respbody() local 2306 chunkqueue_length(cq) in magnet_respbody() 2344 chunkqueue * const cq = &r->reqbody_queue; in magnet_reqbody_add() local 2345 const int tempfile = (cq->last && cq->last->file.is_temp); in magnet_reqbody_add() 2394 chunkqueue * const cq = &r->reqbody_queue; in magnet_reqbody() local 2416 chunkqueue * const cq = &r->reqbody_queue; in magnet_reqbody() local 2417 if (cq->bytes_in == (off_t)r->reqbody_length) in magnet_reqbody() 2442 chunkqueue * const cq = &r->reqbody_queue; in magnet_reqbody() local 2443 if (cq->bytes_in == (off_t)r->reqbody_length) in magnet_reqbody() 2444 chunkqueue_length(cq) in magnet_reqbody() [all …]
|
| H A D | mod_gnutls.c | 2325 return con->network_read(con, cq, max_bytes); in mod_gnutls_read_err() 2383 chunkqueue_mark_written(cq, wr); in connection_write_cq_ssl() 2402 while (max_bytes > 0 && !chunkqueue_is_empty(cq)) { in connection_write_cq_ssl() 2411 chunkqueue_remove_finished_chunks(cq); in connection_write_cq_ssl() 2440 chunkqueue_mark_written(cq, wr_total); in connection_write_cq_ssl() 2468 chunkqueue_mark_written(cq, wr); in connection_write_cq_ssl_ktls() 2494 chunkqueue_mark_written(cq, wr); in connection_write_cq_ssl_ktls() 2500 return connection_write_cq_ssl(con, cq, max_bytes); in connection_write_cq_ssl_ktls() 2564 chunk * const ckpt = cq->last; in connection_read_cq_ssl() 2565 mem = chunkqueue_get_memory(cq, &mem_len); in connection_read_cq_ssl() [all …]
|
| H A D | mod_openssl.c | 3040 while (max_bytes > 0 && !chunkqueue_is_empty(cq)) { in connection_write_cq_ssl() 3047 if (0 != chunkqueue_peek_data(cq, &data, &data_len, errh)) return -1; in connection_write_cq_ssl() 3049 chunkqueue_remove_finished_chunks(cq); in connection_write_cq_ssl() 3074 chunkqueue_mark_written(cq, wr); in connection_write_cq_ssl() 3099 for (chunk *c; (c = cq->first) && c->type == FILE_CHUNK; ) { in connection_write_cq_ssl_ktls() 3111 chunkqueue_mark_written(cq, wr); in connection_write_cq_ssl_ktls() 3117 return connection_write_cq_ssl(con, cq, max_bytes); in connection_write_cq_ssl_ktls() 3139 chunk * const ckpt = cq->last; in connection_read_cq_ssl() 3140 mem = chunkqueue_get_memory(cq, &mem_len); in connection_read_cq_ssl() 3143 chunkqueue_use_memory(cq, ckpt, len > 0 ? len : 0); in connection_read_cq_ssl() [all …]
|
| H A D | h2.h | 107 uint32_t h2_send_cqdata (request_st *r, connection *con, struct chunkqueue *cq, uint32_t dlen);
|
| H A D | response.h | 59 int http_response_transfer_cqlen(request_st *r, struct chunkqueue *cq, size_t len);
|
| H A D | http-header-glue.c | 811 int http_response_transfer_cqlen(request_st * const r, chunkqueue * const cq, size_t len) { in http_response_transfer_cqlen() argument 826 int rc = http_chunk_transfer_cqlen(r, cq, len); in http_response_transfer_cqlen() 830 chunkqueue_mark_written(cq, (off_t)(olen - len)); in http_response_transfer_cqlen() 838 for (const chunk *c = cq->first; c && remain; c=c->next, remain-=wr) { in http_response_transfer_cqlen() 845 chunkqueue_mark_written(cq, len); in http_response_transfer_cqlen()
|
| H A D | mod_wolfssl.c | 2732 connection_write_cq_ssl (connection * const con, chunkqueue * const cq, off_t max_bytes) in connection_write_cq_ssl() argument 2741 while (max_bytes > 0 && !chunkqueue_is_empty(cq)) { in connection_write_cq_ssl() 2748 if (0 != chunkqueue_peek_data(cq, &data, &data_len, errh)) return -1; in connection_write_cq_ssl() 2750 chunkqueue_remove_finished_chunks(cq); in connection_write_cq_ssl() 2824 chunkqueue_mark_written(cq, wr); in connection_write_cq_ssl() 2835 connection_read_cq_ssl (connection * const con, chunkqueue * const cq, off_t max_bytes) in connection_read_cq_ssl() argument 2851 chunk * const ckpt = cq->last; in connection_read_cq_ssl() 2852 mem = chunkqueue_get_memory(cq, &mem_len); in connection_read_cq_ssl() 2855 chunkqueue_use_memory(cq, ckpt, len > 0 ? len : 0); in connection_read_cq_ssl() 2871 chunkqueue_reset(cq); in connection_read_cq_ssl() [all …]
|
| H A D | mod_mbedtls.c | 2024 connection_write_cq_ssl (connection * const con, chunkqueue * const cq, off_t max_bytes) in connection_write_cq_ssl() argument 2043 chunkqueue_mark_written(cq, wr); in connection_write_cq_ssl() 2053 while (max_bytes > 0 && !chunkqueue_is_empty(cq)) { in connection_write_cq_ssl() 2060 if (0 != chunkqueue_peek_data(cq, &data, &data_len, errh)) return -1; in connection_write_cq_ssl() 2062 chunkqueue_remove_finished_chunks(cq); in connection_write_cq_ssl() 2091 if (wr_total) chunkqueue_mark_written(cq, wr_total); in connection_write_cq_ssl() 2097 chunkqueue_mark_written(cq, wr_total); in connection_write_cq_ssl() 2243 connection_read_cq_ssl (connection * const con, chunkqueue * const cq, off_t max_bytes) in connection_read_cq_ssl() argument 2263 chunk * const ckpt = cq->last; in connection_read_cq_ssl() 2264 mem = chunkqueue_get_memory(cq, &mem_len); in connection_read_cq_ssl() [all …]
|
| /lighttpd1.4/src/t/ |
| H A D | test_mod_ssi.c | 43 chunkqueue * const cq = &r->write_queue; in test_mod_ssi_read_fd() local 64 assert(cq->first); in test_mod_ssi_read_fd() 65 assert(buffer_eq_slen(cq->first->mem, in test_mod_ssi_read_fd() 74 assert(NULL == cq->first); in test_mod_ssi_read_fd() 80 assert(cq->first); in test_mod_ssi_read_fd() 81 assert(cq->first->type == FILE_CHUNK); in test_mod_ssi_read_fd() 82 assert(2 == chunkqueue_length(cq)); in test_mod_ssi_read_fd() 84 if (0 != lseek(cq->first->file.fd, 0, SEEK_SET) in test_mod_ssi_read_fd() 85 || 2 != read(cq->first->file.fd, buf, sizeof(buf))) { in test_mod_ssi_read_fd() 126 chunkqueue_read_squash(cq, r->conf.errh); in test_mod_ssi_read_fd() [all …]
|