diff options
author | Max Romanov <max.romanov@nginx.com> | 2019-03-21 13:55:57 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2019-03-21 13:55:57 +0300 |
commit | 452ce0789e8e8f1ac98cc0ed7efce03656a3d616 (patch) | |
tree | 395a7f6964448568ec8521e6cd1338763a9d743f /src/nxt_h1proto.c | |
parent | 39e147a858e7d135aa224a308b4d41061e00c296 (diff) | |
download | unit-452ce0789e8e8f1ac98cc0ed7efce03656a3d616.tar.gz unit-452ce0789e8e8f1ac98cc0ed7efce03656a3d616.tar.bz2 |
Adjusting request schema value according to connection tls state.
This closes #223 issue on GitHub.
Diffstat (limited to 'src/nxt_h1proto.c')
-rw-r--r-- | src/nxt_h1proto.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/nxt_h1proto.c b/src/nxt_h1proto.c index 07e3c7bc..3a822042 100644 --- a/src/nxt_h1proto.c +++ b/src/nxt_h1proto.c @@ -35,6 +35,7 @@ static void nxt_h1p_request_body_read(nxt_task_t *task, nxt_http_request_t *r); static void nxt_h1p_conn_request_body_read(nxt_task_t *task, void *obj, void *data); static void nxt_h1p_request_local_addr(nxt_task_t *task, nxt_http_request_t *r); +static void nxt_h1p_request_tls(nxt_task_t *task, nxt_http_request_t *r); static void nxt_h1p_request_header_send(nxt_task_t *task, nxt_http_request_t *r); static void nxt_h1p_request_send(nxt_task_t *task, nxt_http_request_t *r, @@ -103,6 +104,13 @@ const nxt_http_proto_local_addr_t nxt_http_proto_local_addr[3] = { }; +const nxt_http_proto_tls_t nxt_http_proto_tls[3] = { + nxt_h1p_request_tls, + NULL, + NULL, +}; + + const nxt_http_proto_header_send_t nxt_http_proto_header_send[3] = { nxt_h1p_request_header_send, NULL, @@ -813,6 +821,15 @@ nxt_h1p_request_local_addr(nxt_task_t *task, nxt_http_request_t *r) } +static void +nxt_h1p_request_tls(nxt_task_t *task, nxt_http_request_t *r) +{ +#if (NXT_TLS) + r->tls = r->proto.h1->conn->u.tls; +#endif +} + + #define NXT_HTTP_LAST_SUCCESS \ (NXT_HTTP_OK + nxt_nitems(nxt_http_success) - 1) |