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
982 if (nxt_slow_path(rbuf->size < (ssize_t) sizeof(nxt_port_msg_t))) { in nxt_unit_process_msg()
983 if (nxt_slow_path(rbuf->size == 0)) { in nxt_unit_process_msg()
991 nxt_unit_alert(ctx, "message too small (%d bytes)", (int) rbuf->size); in nxt_unit_process_msg()
1010 recv_msg.size = rbuf->size - sizeof(nxt_port_msg_t); in nxt_unit_process_msg()
1047 if (recv_msg.size == sizeof(quit_param)) { in nxt_unit_process_msg()
1111 if (nxt_slow_path(recv_msg.size != sizeof(pid))) { in nxt_unit_process_msg()
1113 "(%d != %d)", port_msg->stream, (int) recv_msg.size, in nxt_unit_process_msg()
1158 memset(rbuf->buf, 0xAC, rbuf->size); in nxt_unit_process_msg()
1174 if (nxt_slow_path(recv_msg->size != sizeof(nxt_port_msg_new_port_t))) { in nxt_unit_process_new_port()
1177 recv_msg->stream, (int) recv_msg->size); in nxt_unit_process_new_port()
1288 if (nxt_slow_path(recv_msg->size < sizeof(nxt_unit_request_t))) { in nxt_unit_process_req_headers()
1290 "%d expected", recv_msg->stream, (int) recv_msg->size, in nxt_unit_process_req_headers()
1627 if (cb->websocket_handler && recv_msg->size >= 2) { in nxt_unit_process_websocket()
1666 b->buf.end = b->buf.start + recv_msg->size; in nxt_unit_process_websocket()
2288 const void* src, uint32_t size) in nxt_unit_response_add_content() argument
2310 if (nxt_slow_path(size > (uint32_t) (buf->end - buf->free))) { in nxt_unit_response_add_content()
2323 resp->piggyback_content_length += size; in nxt_unit_response_add_content()
2325 buf->free = nxt_cpymem(buf->free, src, size); in nxt_unit_response_add_content()
2388 nxt_unit_response_buf_alloc(nxt_unit_request_info_t *req, uint32_t size) in nxt_unit_response_buf_alloc() argument
2394 if (nxt_slow_path(size > PORT_MMAP_DATA_SIZE)) { in nxt_unit_response_buf_alloc()
2396 "requested buffer (%"PRIu32") too big", size); in nxt_unit_response_buf_alloc()
2401 nxt_unit_req_debug(req, "response_buf_alloc: %"PRIu32, size); in nxt_unit_response_buf_alloc()
2417 size, size, mmap_buf, in nxt_unit_response_buf_alloc()
2637 m.mmap_msg.size = buf->free - buf->start; in nxt_unit_mmap_buf_send()
2644 m.msg.mmap = hdr != NULL && m.mmap_msg.size > 0; in nxt_unit_mmap_buf_send()
2659 (int) m.mmap_msg.size); in nxt_unit_mmap_buf_send()
2710 (int) (sizeof(m.msg) + m.mmap_msg.size)); in nxt_unit_mmap_buf_send()
2714 m.mmap_msg.size + sizeof(m.msg), NULL); in nxt_unit_mmap_buf_send()
2716 if (nxt_slow_path(res != (ssize_t) (m.mmap_msg.size + sizeof(m.msg)))) { in nxt_unit_mmap_buf_send()
2782 rbuf->oob.size = 0; in nxt_unit_read_buf_get()
2860 size_t size) in nxt_unit_response_write() argument
2864 res = nxt_unit_response_write_nb(req, start, size, size); in nxt_unit_response_write()
2872 size_t size, size_t min_size) in nxt_unit_response_write_nb() argument
2882 nxt_unit_req_debug(req, "write: %d", (int) size); in nxt_unit_response_write_nb()
2898 part_size = nxt_min(size, part_size); in nxt_unit_response_write_nb()
2910 size -= part_size; in nxt_unit_response_write_nb()
2917 while (size > 0) { in nxt_unit_response_write_nb()
2918 part_size = nxt_min(size, PORT_MMAP_DATA_SIZE); in nxt_unit_response_write_nb()
2942 size -= part_size; in nxt_unit_response_write_nb()
3056 nxt_unit_request_read(nxt_unit_request_info_t *req, void *dst, size_t size) in nxt_unit_request_read() argument
3061 dst, size); in nxt_unit_request_read()
3063 if (buf_res < (ssize_t) size && req->content_fd != -1) { in nxt_unit_request_read()
3064 res = read(req->content_fd, dst, size); in nxt_unit_request_read()
3072 if (res < (ssize_t) size) { in nxt_unit_request_read()
3143 nxt_unit_request_preread(nxt_unit_request_info_t *req, size_t size) in nxt_unit_request_preread() argument
3159 mmap_buf->free_ptr = nxt_unit_malloc(req->ctx, size); in nxt_unit_request_preread()
3171 mmap_buf->buf.end = mmap_buf->buf.start + size; in nxt_unit_request_preread()
3173 res = read(req->content_fd, mmap_buf->free_ptr, size); in nxt_unit_request_preread()
3183 if (res < (ssize_t) size) { in nxt_unit_request_preread()
3198 nxt_unit_buf_read(nxt_unit_buf_t **b, uint64_t *len, void *dst, size_t size) in nxt_unit_buf_read() argument
3205 rest = size; in nxt_unit_buf_read()
3234 read = size - rest; in nxt_unit_buf_read()
3245 uint32_t size; in nxt_unit_request_done() local
3260 size = nxt_length("Content-Type") + nxt_length("text/plain"); in nxt_unit_request_done()
3262 rc = nxt_unit_response_init(req, 200, 1, size); in nxt_unit_request_done()
3307 uint8_t last, const void *start, size_t size) in nxt_unit_websocket_send() argument
3309 const struct iovec iov = { (void *) start, size }; in nxt_unit_websocket_send()
3402 size_t size) in nxt_unit_websocket_read() argument
3409 dst, size); in nxt_unit_websocket_read()
3430 size_t size, hsize; in nxt_unit_websocket_retain() local
3439 size = ws_impl->buf->buf.end - ws_impl->buf->buf.start; in nxt_unit_websocket_retain()
3441 b = nxt_unit_malloc(ws->req->ctx, size); in nxt_unit_websocket_retain()
3446 memcpy(b, ws_impl->buf->buf.start, size); in nxt_unit_websocket_retain()
3452 ws_impl->buf->buf.end = b + size; in nxt_unit_websocket_retain()
3492 outgoing_size = lib->outgoing.size; in nxt_unit_mmap_get()
3682 if (nxt_fast_path(mmaps->size > i)) { in nxt_unit_mmap_at()
3721 if (i + 1 > mmaps->size) { in nxt_unit_mmap_at()
3722 mmaps->size = i + 1; in nxt_unit_mmap_at()
3740 mm = nxt_unit_mmap_at(&lib->outgoing, lib->outgoing.size); in nxt_unit_new_mmap()
3768 hdr->id = lib->outgoing.size - 1; in nxt_unit_new_mmap()
3805 lib->outgoing.size--; in nxt_unit_new_mmap()
3812 nxt_unit_shm_open(nxt_unit_ctx_t *ctx, size_t size) in nxt_unit_shm_open() argument
3871 if (nxt_slow_path(ftruncate(fd, size) == -1)) { in nxt_unit_shm_open()
3917 uint32_t size, uint32_t min_size, in nxt_unit_get_outgoing_buf() argument
3924 if (size <= NXT_UNIT_MAX_PLAIN_SIZE) { in nxt_unit_get_outgoing_buf()
3931 size + sizeof(nxt_port_msg_t)); in nxt_unit_get_outgoing_buf()
3942 mmap_buf->buf.end = mmap_buf->buf.start + size; in nxt_unit_get_outgoing_buf()
3945 mmap_buf->buf.start, (int) size); in nxt_unit_get_outgoing_buf()
3950 nchunks = (size + PORT_MMAP_CHUNK_SIZE - 1) / PORT_MMAP_CHUNK_SIZE; in nxt_unit_get_outgoing_buf()
4105 mmaps->size = 0; in nxt_unit_mmaps_init()
4140 end = mmaps->elts + mmaps->size; in nxt_unit_mmaps_destroy()
4206 uint32_t size; in nxt_unit_mmap_read() local
4213 if (nxt_slow_path(recv_msg->size < sizeof(nxt_port_mmap_msg_t))) { in nxt_unit_mmap_read()
4215 recv_msg->stream, (int) recv_msg->size); in nxt_unit_mmap_read()
4221 end = nxt_pointer_to(recv_msg->start, recv_msg->size); in nxt_unit_mmap_read()
4266 size = mmap_msg->size; in nxt_unit_mmap_read()
4270 recv_msg->size = size; in nxt_unit_mmap_read()
4275 b->buf.end = b->buf.start + size; in nxt_unit_mmap_read()
4282 start, (int) size, in nxt_unit_mmap_read()
4285 (int) mmap_msg->size); in nxt_unit_mmap_read()
4330 void *start, uint32_t size) in nxt_unit_mmap_release() argument
4337 memset(start, 0xA5, size); in nxt_unit_mmap_release()
4340 end = p + size; in nxt_unit_mmap_release()
4632 (int) rbuf->size); in nxt_unit_read_buf()
4671 rbuf->size = -1; in nxt_unit_read_buf()
4886 if (nxt_fast_path(rbuf->size == (ssize_t) sizeof(nxt_port_msg_t))) { in nxt_unit_is_read_queue()
4899 if (nxt_fast_path(rbuf->size == 1)) { in nxt_unit_is_read_socket()
4912 if (nxt_fast_path(rbuf->size == (ssize_t) sizeof(nxt_port_msg_t))) { in nxt_unit_is_shm_ack()
4927 if (nxt_fast_path(rbuf->size == (ssize_t) sizeof(nxt_port_msg_t))) { in nxt_unit_is_quit()
5901 if (port_impl->queue != NULL && (oob == NULL || oob->size == 0) in nxt_unit_port_send()
5961 oob != NULL ? oob->size : 0); in nxt_unit_port_send()
6010 (oob != NULL ? (int) oob->size : 0), (int) n); in nxt_unit_sendmsg()
6032 && port_impl->socket_rbuf->size > 0) in nxt_unit_ctx_port_recv()
6037 port_impl->socket_rbuf->size = 0; in nxt_unit_ctx_port_recv()
6041 (int) rbuf->size); in nxt_unit_ctx_port_recv()
6062 (int) rbuf->size); in nxt_unit_ctx_port_recv()
6081 (int) port->id.pid, (int) port->id.id, (int) rbuf->size); in nxt_unit_ctx_port_recv()
6088 (int) rbuf->size); in nxt_unit_ctx_port_recv()
6102 (int) rbuf->size); in nxt_unit_ctx_port_recv()
6111 port_impl->socket_rbuf->size = 0; in nxt_unit_ctx_port_recv()
6114 if (port_impl->socket_rbuf->size > 0) { in nxt_unit_ctx_port_recv()
6122 rbuf->oob.size = 0; in nxt_unit_ctx_port_recv()
6131 memcpy(dst->buf, src->buf, src->size); in nxt_unit_rbuf_cpy()
6132 dst->size = src->size; in nxt_unit_rbuf_cpy()
6133 dst->oob.size = src->oob.size; in nxt_unit_rbuf_cpy()
6134 memcpy(dst->oob.buf, src->oob.buf, src->oob.size); in nxt_unit_rbuf_cpy()
6165 (int) port->id.pid, (int) port->id.id, (int) rbuf->size); in nxt_unit_shared_port_recv()
6189 rbuf->size = lib->callbacks.port_recv(ctx, port, in nxt_unit_port_recv()
6194 (int) port->id.pid, (int) port->id.id, (int) rbuf->size); in nxt_unit_port_recv()
6196 if (nxt_slow_path(rbuf->size < 0)) { in nxt_unit_port_recv()
6200 rbuf->oob.size = oob_size; in nxt_unit_port_recv()
6211 rbuf->size = nxt_recvmsg(fd, iov, 1, &rbuf->oob); in nxt_unit_port_recv()
6213 if (nxt_slow_path(rbuf->size == -1)) { in nxt_unit_port_recv()
6233 nxt_unit_debug(ctx, "recvmsg(%d): %d", fd, (int) rbuf->size); in nxt_unit_port_recv()
6246 rbuf->size = nxt_port_queue_recv(port_impl->queue, rbuf->buf); in nxt_unit_port_queue_recv()
6248 return (rbuf->size == -1) ? NXT_UNIT_AGAIN : NXT_UNIT_OK; in nxt_unit_port_queue_recv()
6272 rbuf->size = nxt_app_queue_recv(queue, rbuf->buf, &cookie); in nxt_unit_app_queue_recv()
6274 nxt_unit_debug(NULL, "app_queue_recv: %d", (int) rbuf->size); in nxt_unit_app_queue_recv()
6276 if (rbuf->size >= (ssize_t) sizeof(nxt_port_msg_t)) { in nxt_unit_app_queue_recv()
6307 return (rbuf->size == -1) ? NXT_UNIT_AGAIN : NXT_UNIT_OK; in nxt_unit_app_queue_recv()
6704 nxt_unit_lvlhsh_alloc(void *data, size_t size) in nxt_unit_lvlhsh_alloc() argument
6709 err = posix_memalign(&p, size, size); in nxt_unit_lvlhsh_alloc()
6713 (int) size, (int) size, p); in nxt_unit_lvlhsh_alloc()
6718 (int) size, (int) size, strerror(err), err); in nxt_unit_lvlhsh_alloc()
6731 nxt_unit_malloc(nxt_unit_ctx_t *ctx, size_t size) in nxt_unit_malloc() argument
6735 p = malloc(size); in nxt_unit_malloc()
6739 nxt_unit_debug(ctx, "malloc(%d): %p", (int) size, p); in nxt_unit_malloc()
6744 (int) size, strerror(errno), errno); in nxt_unit_malloc()