diff options
author | Igor Sysoev <igor@sysoev.ru> | 2018-09-20 15:05:37 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2018-09-20 15:05:37 +0300 |
commit | 96cd68b34037f8b6d9a1d43f67b8fe7c1df2ef9e (patch) | |
tree | 8e648712993012fbe815cc92e6debab20449fe8f /src/nxt_conn_write.c | |
parent | e964e982fd64505fb8644f91e5c57a869038cd18 (diff) | |
download | unit-96cd68b34037f8b6d9a1d43f67b8fe7c1df2ef9e.tar.gz unit-96cd68b34037f8b6d9a1d43f67b8fe7c1df2ef9e.tar.bz2 |
Added SSL/TLS support on connection level.
Diffstat (limited to '')
-rw-r--r-- | src/nxt_conn_write.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/src/nxt_conn_write.c b/src/nxt_conn_write.c index 27b4b965..73c3fa02 100644 --- a/src/nxt_conn_write.c +++ b/src/nxt_conn_write.c @@ -44,12 +44,15 @@ nxt_conn_io_write(nxt_task_t *task, void *obj, void *data) sb.sent = 0; sb.size = 0; sb.buf = b; +#if (NXT_TLS) + sb.tls = c->u.tls; +#endif sb.limit = 10 * 1024 * 1024; sb.ready = 1; sb.sync = 0; do { - ret = nxt_conn_io_sendbuf(task, &sb); + ret = c->io->sendbuf(task, &sb); c->socket.write_ready = sb.ready; c->socket.error = sb.error; @@ -100,7 +103,7 @@ nxt_conn_io_write(nxt_task_t *task, void *obj, void *data) /* * SSL libraries can require to toggle either write or read * event if renegotiation occurs during SSL write operation. - * This case is handled on the event_io->send() level. Timer + * This case is handled on the c->io->send() level. Timer * can be set here because it should be set only for write * direction. */ @@ -302,23 +305,6 @@ nxt_event_conn_write_delayed(nxt_event_engine_t *engine, nxt_conn_t *c, ssize_t -nxt_event_conn_io_write_chunk(nxt_conn_t *c, nxt_buf_t *b, size_t limit) -{ - ssize_t ret; - - ret = c->io->sendbuf(c, b, limit); - - if ((ret == NXT_AGAIN || !c->socket.write_ready) - && nxt_fd_event_is_disabled(c->socket.write)) - { - nxt_fd_event_enable_write(c->socket.task->thread->engine, &c->socket); - } - - return ret; -} - - -ssize_t nxt_event_conn_io_sendbuf(nxt_conn_t *c, nxt_buf_t *b, size_t limit) { nxt_uint_t niob; |