summaryrefslogtreecommitdiffhomepage
path: root/src/go
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2017-10-19 17:36:45 +0300
committerMax Romanov <max.romanov@nginx.com>2017-10-19 17:36:45 +0300
commit6fd465f9d24040946f4218c281bd82517d5a350c (patch)
treeaffe30b3da0ad8844d646d640dc6fb4ff8f89e0e /src/go
parent39fd38a948762d24f5860adb0bf8c78b6d65d79a (diff)
downloadunit-6fd465f9d24040946f4218c281bd82517d5a350c.tar.gz
unit-6fd465f9d24040946f4218c281bd82517d5a350c.tar.bz2
Introducing src_pid for mmap header for accurate buf completion.
This allows to use shared memory to communicate with main process. This patch changes shared memory segment format and breaks compatibility with older modules.
Diffstat (limited to 'src/go')
-rw-r--r--src/go/unit/nxt_go_port_memory.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/go/unit/nxt_go_port_memory.c b/src/go/unit/nxt_go_port_memory.c
index d2c0a0aa..310e17cb 100644
--- a/src/go/unit/nxt_go_port_memory.c
+++ b/src/go/unit/nxt_go_port_memory.c
@@ -105,7 +105,8 @@ nxt_go_new_port_mmap(nxt_go_process_t *process, nxt_port_id_t id)
memset(hdr->free_map, 0xFFU, sizeof(hdr->free_map));
hdr->id = process->outgoing.nelts - 1;
- hdr->pid = process->pid;
+ hdr->src_pid = getpid();
+ hdr->dst_pid = process->pid;
hdr->sent_over = id;
/* Mark first chunk as busy */
@@ -136,7 +137,7 @@ nxt_go_new_port_mmap(nxt_go_process_t *process, nxt_port_id_t id)
*/
memcpy(CMSG_DATA(&cmsg.cm), &fd, sizeof(int));
- rc = nxt_go_port_send(hdr->pid, id, &port_msg, sizeof(port_msg),
+ rc = nxt_go_port_send(hdr->dst_pid, id, &port_msg, sizeof(port_msg),
&cmsg, sizeof(cmsg));
nxt_go_debug("new mmap #%d created for %d -> %d",