diff options
author | Max Romanov <max.romanov@nginx.com> | 2017-08-11 18:04:04 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2017-08-11 18:04:04 +0300 |
commit | e1e808bd94609c80b4990939285d47f124bb2eef (patch) | |
tree | 6eea54a1ba52bd0cb3687f3c8d46399cb06ab227 /src/nxt_port_socket.c | |
parent | 162afe4719afcba65b5477a75cee4cbba8874892 (diff) | |
download | unit-e1e808bd94609c80b4990939285d47f124bb2eef.tar.gz unit-e1e808bd94609c80b4990939285d47f124bb2eef.tar.bz2 |
Sync flag introduced for port type.
To avoid transfer mmap_msg before new mmap message.
Diffstat (limited to 'src/nxt_port_socket.c')
-rw-r--r-- | src/nxt_port_socket.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/nxt_port_socket.c b/src/nxt_port_socket.c index de11549b..82a6e0aa 100644 --- a/src/nxt_port_socket.c +++ b/src/nxt_port_socket.c @@ -171,10 +171,15 @@ nxt_port_socket_write(nxt_task_t *task, nxt_port_t *port, nxt_uint_t type, nxt_queue_each(msg, &port->messages, nxt_port_send_msg_t, link) { - if (msg->port_msg.stream == stream && - msg->port_msg.reply_port == reply_port) { + if ((type & NXT_PORT_MSG_SYNC) != 0) { + msg->opened = 0; + continue; + } - nxt_assert(msg->port_msg.last == 0); + if (msg->port_msg.stream == stream && + msg->port_msg.reply_port == reply_port && + msg->port_msg.last == 0 && + msg->opened) { /* * An fd is ignored since a file descriptor @@ -201,6 +206,7 @@ nxt_port_socket_write(nxt_task_t *task, nxt_port_t *port, nxt_uint_t type, msg->fd = fd; msg->close_fd = (type & NXT_PORT_MSG_CLOSE_FD) != 0; msg->share = 0; + msg->opened = 1; msg->work.next = NULL; msg->work.handler = nxt_port_release_send_msg; |