nxt_port_socket.c (1996:35873fa78fed) nxt_port_socket.c (2139:99d792169ffb)
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8#include <nxt_socket_msg.h>

--- 5 unchanged lines hidden (view full) ---

14 (int) (NXT_PORT_QUEUE_MSG_SIZE - sizeof(nxt_port_msg_t))
15
16
17static nxt_bool_t nxt_port_can_enqueue_buf(nxt_buf_t *b);
18static uint8_t nxt_port_enqueue_buf(nxt_task_t *task, nxt_port_msg_t *pm,
19 void *qbuf, nxt_buf_t *b);
20static nxt_int_t nxt_port_msg_chk_insert(nxt_task_t *task, nxt_port_t *port,
21 nxt_port_send_msg_t *msg);
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8#include <nxt_socket_msg.h>

--- 5 unchanged lines hidden (view full) ---

14 (int) (NXT_PORT_QUEUE_MSG_SIZE - sizeof(nxt_port_msg_t))
15
16
17static nxt_bool_t nxt_port_can_enqueue_buf(nxt_buf_t *b);
18static uint8_t nxt_port_enqueue_buf(nxt_task_t *task, nxt_port_msg_t *pm,
19 void *qbuf, nxt_buf_t *b);
20static nxt_int_t nxt_port_msg_chk_insert(nxt_task_t *task, nxt_port_t *port,
21 nxt_port_send_msg_t *msg);
22static nxt_port_send_msg_t *nxt_port_msg_alloc(nxt_port_send_msg_t *m);
22static nxt_port_send_msg_t *nxt_port_msg_alloc(const nxt_port_send_msg_t *m);
23static void nxt_port_write_handler(nxt_task_t *task, void *obj, void *data);
24static nxt_port_send_msg_t *nxt_port_msg_first(nxt_port_t *port);
25nxt_inline void nxt_port_msg_close_fd(nxt_port_send_msg_t *msg);
26nxt_inline void nxt_port_close_fds(nxt_fd_t *fd);
27static nxt_buf_t *nxt_port_buf_completion(nxt_task_t *task,
28 nxt_work_queue_t *wq, nxt_buf_t *b, size_t sent, nxt_bool_t mmap_mode);
29static nxt_port_send_msg_t *nxt_port_msg_insert_tail(nxt_port_t *port,
30 nxt_port_send_msg_t *msg);

--- 296 unchanged lines hidden (view full) ---

327
328 nxt_thread_mutex_unlock(&port->write_mutex);
329
330 return res;
331}
332
333
334static nxt_port_send_msg_t *
23static void nxt_port_write_handler(nxt_task_t *task, void *obj, void *data);
24static nxt_port_send_msg_t *nxt_port_msg_first(nxt_port_t *port);
25nxt_inline void nxt_port_msg_close_fd(nxt_port_send_msg_t *msg);
26nxt_inline void nxt_port_close_fds(nxt_fd_t *fd);
27static nxt_buf_t *nxt_port_buf_completion(nxt_task_t *task,
28 nxt_work_queue_t *wq, nxt_buf_t *b, size_t sent, nxt_bool_t mmap_mode);
29static nxt_port_send_msg_t *nxt_port_msg_insert_tail(nxt_port_t *port,
30 nxt_port_send_msg_t *msg);

--- 296 unchanged lines hidden (view full) ---

327
328 nxt_thread_mutex_unlock(&port->write_mutex);
329
330 return res;
331}
332
333
334static nxt_port_send_msg_t *
335nxt_port_msg_alloc(nxt_port_send_msg_t *m)
335nxt_port_msg_alloc(const nxt_port_send_msg_t *m)
336{
337 nxt_port_send_msg_t *msg;
338
339 msg = nxt_malloc(sizeof(nxt_port_send_msg_t));
340 if (nxt_slow_path(msg == NULL)) {
341 return NULL;
342 }
343

--- 1043 unchanged lines hidden ---
336{
337 nxt_port_send_msg_t *msg;
338
339 msg = nxt_malloc(sizeof(nxt_port_send_msg_t));
340 if (nxt_slow_path(msg == NULL)) {
341 return NULL;
342 }
343

--- 1043 unchanged lines hidden ---