Lines Matching refs:size

99     nxt_unit_request_info_t *req, size_t size);
101 size_t size);
109 static int nxt_unit_shm_open(nxt_unit_ctx_t *ctx, size_t size);
113 nxt_unit_port_t *port, uint32_t size,
130 nxt_port_mmap_header_t *hdr, void *start, uint32_t size);
201 static void *nxt_unit_lvlhsh_alloc(void *data, size_t size);
229 uint32_t size; member
281 ssize_t size; member
344 uint32_t size; member
996 if (nxt_slow_path(rbuf->size < (ssize_t) sizeof(nxt_port_msg_t))) { in nxt_unit_process_msg()
997 if (nxt_slow_path(rbuf->size == 0)) { in nxt_unit_process_msg()
1005 nxt_unit_alert(ctx, "message too small (%d bytes)", (int) rbuf->size); in nxt_unit_process_msg()
1024 recv_msg.size = rbuf->size - sizeof(nxt_port_msg_t); in nxt_unit_process_msg()
1061 if (recv_msg.size == sizeof(quit_param)) { in nxt_unit_process_msg()
1125 if (nxt_slow_path(recv_msg.size != sizeof(pid))) { in nxt_unit_process_msg()
1127 "(%d != %d)", port_msg->stream, (int) recv_msg.size, in nxt_unit_process_msg()
1172 memset(rbuf->buf, 0xAC, rbuf->size); in nxt_unit_process_msg()
1188 if (nxt_slow_path(recv_msg->size != sizeof(nxt_port_msg_new_port_t))) { in nxt_unit_process_new_port()
1191 recv_msg->stream, (int) recv_msg->size); in nxt_unit_process_new_port()
1302 if (nxt_slow_path(recv_msg->size < sizeof(nxt_unit_request_t))) { in nxt_unit_process_req_headers()
1304 "%d expected", recv_msg->stream, (int) recv_msg->size, in nxt_unit_process_req_headers()
1641 if (cb->websocket_handler && recv_msg->size >= 2) { in nxt_unit_process_websocket()
1680 b->buf.end = b->buf.start + recv_msg->size; in nxt_unit_process_websocket()
2302 const void* src, uint32_t size) in nxt_unit_response_add_content() argument
2324 if (nxt_slow_path(size > (uint32_t) (buf->end - buf->free))) { in nxt_unit_response_add_content()
2337 resp->piggyback_content_length += size; in nxt_unit_response_add_content()
2339 buf->free = nxt_cpymem(buf->free, src, size); in nxt_unit_response_add_content()
2402 nxt_unit_response_buf_alloc(nxt_unit_request_info_t *req, uint32_t size) in nxt_unit_response_buf_alloc() argument
2408 if (nxt_slow_path(size > PORT_MMAP_DATA_SIZE)) { in nxt_unit_response_buf_alloc()
2410 "requested buffer (%"PRIu32") too big", size); in nxt_unit_response_buf_alloc()
2415 nxt_unit_req_debug(req, "response_buf_alloc: %"PRIu32, size); in nxt_unit_response_buf_alloc()
2431 size, size, mmap_buf, in nxt_unit_response_buf_alloc()
2651 m.mmap_msg.size = buf->free - buf->start; in nxt_unit_mmap_buf_send()
2658 m.msg.mmap = hdr != NULL && m.mmap_msg.size > 0; in nxt_unit_mmap_buf_send()
2673 (int) m.mmap_msg.size); in nxt_unit_mmap_buf_send()
2724 (int) (sizeof(m.msg) + m.mmap_msg.size)); in nxt_unit_mmap_buf_send()
2728 m.mmap_msg.size + sizeof(m.msg), NULL); in nxt_unit_mmap_buf_send()
2730 if (nxt_slow_path(res != (ssize_t) (m.mmap_msg.size + sizeof(m.msg)))) { in nxt_unit_mmap_buf_send()
2796 rbuf->oob.size = 0; in nxt_unit_read_buf_get()
2874 size_t size) in nxt_unit_response_write() argument
2878 res = nxt_unit_response_write_nb(req, start, size, size); in nxt_unit_response_write()
2886 size_t size, size_t min_size) in nxt_unit_response_write_nb() argument
2896 nxt_unit_req_debug(req, "write: %d", (int) size); in nxt_unit_response_write_nb()
2912 part_size = nxt_min(size, part_size); in nxt_unit_response_write_nb()
2924 size -= part_size; in nxt_unit_response_write_nb()
2931 while (size > 0) { in nxt_unit_response_write_nb()
2932 part_size = nxt_min(size, PORT_MMAP_DATA_SIZE); in nxt_unit_response_write_nb()
2956 size -= part_size; in nxt_unit_response_write_nb()
3070 nxt_unit_request_read(nxt_unit_request_info_t *req, void *dst, size_t size) in nxt_unit_request_read() argument
3075 dst, size); in nxt_unit_request_read()
3077 if (buf_res < (ssize_t) size && req->content_fd != -1) { in nxt_unit_request_read()
3078 res = read(req->content_fd, dst, size); in nxt_unit_request_read()
3086 if (res < (ssize_t) size) { in nxt_unit_request_read()
3157 nxt_unit_request_preread(nxt_unit_request_info_t *req, size_t size) in nxt_unit_request_preread() argument
3173 mmap_buf->free_ptr = nxt_unit_malloc(req->ctx, size); in nxt_unit_request_preread()
3185 mmap_buf->buf.end = mmap_buf->buf.start + size; in nxt_unit_request_preread()
3187 res = read(req->content_fd, mmap_buf->free_ptr, size); in nxt_unit_request_preread()
3197 if (res < (ssize_t) size) { in nxt_unit_request_preread()
3212 nxt_unit_buf_read(nxt_unit_buf_t **b, uint64_t *len, void *dst, size_t size) in nxt_unit_buf_read() argument
3219 rest = size; in nxt_unit_buf_read()
3248 read = size - rest; in nxt_unit_buf_read()
3259 uint32_t size; in nxt_unit_request_done() local
3274 size = nxt_length("Content-Type") + nxt_length("text/plain"); in nxt_unit_request_done()
3276 rc = nxt_unit_response_init(req, 200, 1, size); in nxt_unit_request_done()
3321 uint8_t last, const void *start, size_t size) in nxt_unit_websocket_send() argument
3323 const struct iovec iov = { (void *) start, size }; in nxt_unit_websocket_send()
3416 size_t size) in nxt_unit_websocket_read() argument
3423 dst, size); in nxt_unit_websocket_read()
3444 size_t size, hsize; in nxt_unit_websocket_retain() local
3453 size = ws_impl->buf->buf.end - ws_impl->buf->buf.start; in nxt_unit_websocket_retain()
3455 b = nxt_unit_malloc(ws->req->ctx, size); in nxt_unit_websocket_retain()
3460 memcpy(b, ws_impl->buf->buf.start, size); in nxt_unit_websocket_retain()
3466 ws_impl->buf->buf.end = b + size; in nxt_unit_websocket_retain()
3506 outgoing_size = lib->outgoing.size; in nxt_unit_mmap_get()
3696 if (nxt_fast_path(mmaps->size > i)) { in nxt_unit_mmap_at()
3735 if (i + 1 > mmaps->size) { in nxt_unit_mmap_at()
3736 mmaps->size = i + 1; in nxt_unit_mmap_at()
3754 mm = nxt_unit_mmap_at(&lib->outgoing, lib->outgoing.size); in nxt_unit_new_mmap()
3782 hdr->id = lib->outgoing.size - 1; in nxt_unit_new_mmap()
3819 lib->outgoing.size--; in nxt_unit_new_mmap()
3826 nxt_unit_shm_open(nxt_unit_ctx_t *ctx, size_t size) in nxt_unit_shm_open() argument
3885 if (nxt_slow_path(ftruncate(fd, size) == -1)) { in nxt_unit_shm_open()
3931 uint32_t size, uint32_t min_size, in nxt_unit_get_outgoing_buf() argument
3938 if (size <= NXT_UNIT_MAX_PLAIN_SIZE) { in nxt_unit_get_outgoing_buf()
3945 size + sizeof(nxt_port_msg_t)); in nxt_unit_get_outgoing_buf()
3956 mmap_buf->buf.end = mmap_buf->buf.start + size; in nxt_unit_get_outgoing_buf()
3959 mmap_buf->buf.start, (int) size); in nxt_unit_get_outgoing_buf()
3964 nchunks = (size + PORT_MMAP_CHUNK_SIZE - 1) / PORT_MMAP_CHUNK_SIZE; in nxt_unit_get_outgoing_buf()
4117 mmaps->size = 0; in nxt_unit_mmaps_init()
4154 end = mmaps->elts + mmaps->size; in nxt_unit_mmaps_destroy()
4220 uint32_t size; in nxt_unit_mmap_read() local
4227 if (nxt_slow_path(recv_msg->size < sizeof(nxt_port_mmap_msg_t))) { in nxt_unit_mmap_read()
4229 recv_msg->stream, (int) recv_msg->size); in nxt_unit_mmap_read()
4235 end = nxt_pointer_to(recv_msg->start, recv_msg->size); in nxt_unit_mmap_read()
4280 size = mmap_msg->size; in nxt_unit_mmap_read()
4284 recv_msg->size = size; in nxt_unit_mmap_read()
4289 b->buf.end = b->buf.start + size; in nxt_unit_mmap_read()
4296 start, (int) size, in nxt_unit_mmap_read()
4299 (int) mmap_msg->size); in nxt_unit_mmap_read()
4344 void *start, uint32_t size) in nxt_unit_mmap_release() argument
4351 memset(start, 0xA5, size); in nxt_unit_mmap_release()
4354 end = p + size; in nxt_unit_mmap_release()
4646 (int) rbuf->size); in nxt_unit_read_buf()
4685 rbuf->size = -1; in nxt_unit_read_buf()
4900 if (nxt_fast_path(rbuf->size == (ssize_t) sizeof(nxt_port_msg_t))) { in nxt_unit_is_read_queue()
4913 if (nxt_fast_path(rbuf->size == 1)) { in nxt_unit_is_read_socket()
4926 if (nxt_fast_path(rbuf->size == (ssize_t) sizeof(nxt_port_msg_t))) { in nxt_unit_is_shm_ack()
4941 if (nxt_fast_path(rbuf->size == (ssize_t) sizeof(nxt_port_msg_t))) { in nxt_unit_is_quit()
5915 if (port_impl->queue != NULL && (oob == NULL || oob->size == 0) in nxt_unit_port_send()
5975 oob != NULL ? oob->size : 0); in nxt_unit_port_send()
6024 (oob != NULL ? (int) oob->size : 0), (int) n); in nxt_unit_sendmsg()
6046 && port_impl->socket_rbuf->size > 0) in nxt_unit_ctx_port_recv()
6051 port_impl->socket_rbuf->size = 0; in nxt_unit_ctx_port_recv()
6055 (int) rbuf->size); in nxt_unit_ctx_port_recv()
6076 (int) rbuf->size); in nxt_unit_ctx_port_recv()
6095 (int) port->id.pid, (int) port->id.id, (int) rbuf->size); in nxt_unit_ctx_port_recv()
6102 (int) rbuf->size); in nxt_unit_ctx_port_recv()
6116 (int) rbuf->size); in nxt_unit_ctx_port_recv()
6125 port_impl->socket_rbuf->size = 0; in nxt_unit_ctx_port_recv()
6128 if (port_impl->socket_rbuf->size > 0) { in nxt_unit_ctx_port_recv()
6136 rbuf->oob.size = 0; in nxt_unit_ctx_port_recv()
6145 memcpy(dst->buf, src->buf, src->size); in nxt_unit_rbuf_cpy()
6146 dst->size = src->size; in nxt_unit_rbuf_cpy()
6147 dst->oob.size = src->oob.size; in nxt_unit_rbuf_cpy()
6148 memcpy(dst->oob.buf, src->oob.buf, src->oob.size); in nxt_unit_rbuf_cpy()
6179 (int) port->id.pid, (int) port->id.id, (int) rbuf->size); in nxt_unit_shared_port_recv()
6203 rbuf->size = lib->callbacks.port_recv(ctx, port, in nxt_unit_port_recv()
6208 (int) port->id.pid, (int) port->id.id, (int) rbuf->size); in nxt_unit_port_recv()
6210 if (nxt_slow_path(rbuf->size < 0)) { in nxt_unit_port_recv()
6214 rbuf->oob.size = oob_size; in nxt_unit_port_recv()
6225 rbuf->size = nxt_recvmsg(fd, iov, 1, &rbuf->oob); in nxt_unit_port_recv()
6227 if (nxt_slow_path(rbuf->size == -1)) { in nxt_unit_port_recv()
6247 nxt_unit_debug(ctx, "recvmsg(%d): %d", fd, (int) rbuf->size); in nxt_unit_port_recv()
6260 rbuf->size = nxt_port_queue_recv(port_impl->queue, rbuf->buf); in nxt_unit_port_queue_recv()
6262 return (rbuf->size == -1) ? NXT_UNIT_AGAIN : NXT_UNIT_OK; in nxt_unit_port_queue_recv()
6286 rbuf->size = nxt_app_queue_recv(queue, rbuf->buf, &cookie); in nxt_unit_app_queue_recv()
6288 nxt_unit_debug(NULL, "app_queue_recv: %d", (int) rbuf->size); in nxt_unit_app_queue_recv()
6290 if (rbuf->size >= (ssize_t) sizeof(nxt_port_msg_t)) { in nxt_unit_app_queue_recv()
6321 return (rbuf->size == -1) ? NXT_UNIT_AGAIN : NXT_UNIT_OK; in nxt_unit_app_queue_recv()
6718 nxt_unit_lvlhsh_alloc(void *data, size_t size) in nxt_unit_lvlhsh_alloc() argument
6723 err = posix_memalign(&p, size, size); in nxt_unit_lvlhsh_alloc()
6727 (int) size, (int) size, p); in nxt_unit_lvlhsh_alloc()
6732 (int) size, (int) size, strerror(err), err); in nxt_unit_lvlhsh_alloc()
6745 nxt_unit_malloc(nxt_unit_ctx_t *ctx, size_t size) in nxt_unit_malloc() argument
6749 p = malloc(size); in nxt_unit_malloc()
6753 nxt_unit_debug(ctx, "malloc(%d): %p", (int) size, p); in nxt_unit_malloc()
6758 (int) size, strerror(errno), errno); in nxt_unit_malloc()