nxt_port_socket.c (613:e5dd7bc63d59) nxt_port_socket.c (974:c6d9f0ba74be)
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8

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

794 if (nxt_fast_path(msg->port_msg.mf == 0)) {
795
796 b = fmsg->buf;
797
798 port->handler(task, fmsg);
799
800 msg->buf = fmsg->buf;
801 msg->fd = fmsg->fd;
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8

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

794 if (nxt_fast_path(msg->port_msg.mf == 0)) {
795
796 b = fmsg->buf;
797
798 port->handler(task, fmsg);
799
800 msg->buf = fmsg->buf;
801 msg->fd = fmsg->fd;
802
803 /*
804 * To disable instant completion or buffer re-usage,
805 * handler should reset 'msg.buf'.
806 */
807 if (!msg->port_msg.mmap && msg->buf == b) {
808 nxt_port_buf_free(port, b);
809 }
802 }
803 }
804
805 if (nxt_fast_path(msg->port_msg.mf == 0)) {
806 nxt_mp_free(port->mem_pool, fmsg);
807 }
808 } else {
809 if (nxt_slow_path(msg->port_msg.mf != 0)) {

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

890
891 return b;
892}
893
894
895static void
896nxt_port_buf_free(nxt_port_t *port, nxt_buf_t *b)
897{
810 }
811 }
812
813 if (nxt_fast_path(msg->port_msg.mf == 0)) {
814 nxt_mp_free(port->mem_pool, fmsg);
815 }
816 } else {
817 if (nxt_slow_path(msg->port_msg.mf != 0)) {

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

898
899 return b;
900}
901
902
903static void
904nxt_port_buf_free(nxt_port_t *port, nxt_buf_t *b)
905{
898 b->next = port->free_bufs;
906 nxt_buf_chain_add(&b, port->free_bufs);
899 port->free_bufs = b;
900}
901
902
903static void
904nxt_port_error_handler(nxt_task_t *task, void *obj, void *data)
905{
906 int use_delta;

--- 43 unchanged lines hidden ---
907 port->free_bufs = b;
908}
909
910
911static void
912nxt_port_error_handler(nxt_task_t *task, void *obj, void *data)
913{
914 int use_delta;

--- 43 unchanged lines hidden ---