diff options
author | Igor Sysoev <igor@sysoev.ru> | 2017-03-23 15:52:27 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2017-03-23 15:52:27 +0300 |
commit | 3b8963da4d9d92d83431cb35eefb3226d8e177e9 (patch) | |
tree | d491fa80b93b385e5a9b061fdde87a544544bfa9 | |
parent | e4e617469a3f54cecdb808cbc991ff7326c4381c (diff) | |
download | unit-3b8963da4d9d92d83431cb35eefb3226d8e177e9.tar.gz unit-3b8963da4d9d92d83431cb35eefb3226d8e177e9.tar.bz2 |
Event connection writing fixes.
Diffstat (limited to '')
-rw-r--r-- | src/nxt_event_conn_write.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/nxt_event_conn_write.c b/src/nxt_event_conn_write.c index a0f6f953..36d96468 100644 --- a/src/nxt_event_conn_write.c +++ b/src/nxt_event_conn_write.c @@ -46,6 +46,9 @@ nxt_conn_io_write(nxt_task_t *task, void *obj, void *data) do { ret = nxt_conn_io_sendbuf(task, &sb); + c->socket.write_ready = sb.ready; + c->socket.error = sb.error; + if (ret < 0) { /* ret == NXT_AGAIN || ret == NXT_ERROR. */ break; @@ -61,6 +64,8 @@ nxt_conn_io_write(nxt_task_t *task, void *obj, void *data) break; } + sb.buf = b; + if (!c->socket.write_ready) { ret = NXT_AGAIN; break; @@ -95,6 +100,10 @@ nxt_conn_io_write(nxt_task_t *task, void *obj, void *data) * direction. */ nxt_event_conn_timer(engine, c, c->write_state, &c->write_timer); + + if (nxt_fd_event_is_disabled(c->socket.write)) { + nxt_fd_event_enable_write(engine, &c->socket); + } } } |