Redirecting buffer completion handler to specific engine.

There is a case in router where we use port in router connection thread.
Buffers are allocated within connection memory pool which can be used only in
this router thread. sendmsg() can be postponed into main router thread and
completion handler will compare current engine and post itself to correct
engine.
This commit is contained in:
Max Romanov
2017-07-07 16:01:34 +03:00
parent c9fbd832ab
commit f319220a6c
9 changed files with 239 additions and 82 deletions

View File

@@ -36,10 +36,13 @@ typedef struct {
typedef struct {
nxt_queue_link_t link;
nxt_buf_t *buf;
nxt_mp_t *mem_pool;
size_t share;
nxt_fd_t fd;
nxt_port_msg_t port_msg;
nxt_work_t work;
nxt_event_engine_t *engine;
nxt_mp_t *mem_pool;
} nxt_port_send_msg_t;