diff options
author | Max Romanov <max.romanov@nginx.com> | 2017-07-12 20:32:18 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2017-07-12 20:32:18 +0300 |
commit | a97a5e8a0b7a921905994bae101d4f74f5a8aaa4 (patch) | |
tree | 922a2e6fed3630439b56d99b57c7452ee259f617 /src/nginext/nxt_go_run_ctx.c | |
parent | 51bbdd33382eee7da34ff0ed7d0df51ab2345786 (diff) | |
download | unit-a97a5e8a0b7a921905994bae101d4f74f5a8aaa4.tar.gz unit-a97a5e8a0b7a921905994bae101d4f74f5a8aaa4.tar.bz2 |
Go: worker initialization. READY message to master.
Diffstat (limited to 'src/nginext/nxt_go_run_ctx.c')
-rw-r--r-- | src/nginext/nxt_go_run_ctx.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nginext/nxt_go_run_ctx.c b/src/nginext/nxt_go_run_ctx.c index 2d284bc5..0788b0d1 100644 --- a/src/nginext/nxt_go_run_ctx.c +++ b/src/nginext/nxt_go_run_ctx.c @@ -168,6 +168,8 @@ nxt_go_ctx_init(nxt_go_run_ctx_t *ctx, nxt_port_msg_t *port_msg, ctx->wport_msg.type = NXT_PORT_MSG_DATA; ctx->wport_msg.mmap = 1; + ctx->wmmap_msg = (nxt_port_mmap_msg_t *) ( &ctx->wport_msg + 1 ); + return nxt_go_ctx_init_rbuf(ctx); } @@ -197,6 +199,7 @@ nxt_go_ctx_add_msg(nxt_go_run_ctx_t *ctx, nxt_port_msg_t *port_msg, size_t size) nxt_int_t nxt_go_ctx_flush(nxt_go_run_ctx_t *ctx, int last) { + int i; nxt_int_t rc; if (last != 0) { @@ -205,6 +208,13 @@ nxt_go_ctx_flush(nxt_go_run_ctx_t *ctx, int last) nxt_go_debug("flush buffers (%d)", last); + for (i = 0; i < ctx->nwbuf; i++) { + nxt_port_mmap_msg_t *m = ctx->wmmap_msg + i; + + nxt_go_debug(" mmap_msg[%d]={%d, %d, %d}", i, + m->mmap_id, m->chunk_id, m->size); + } + rc = nxt_go_port_send(ctx->msg.port_msg->pid, ctx->msg.port_msg->reply_port, &ctx->wport_msg, sizeof(nxt_port_msg_t) + ctx->nwbuf * sizeof(nxt_port_mmap_msg_t), NULL, 0); |