summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_h1proto.c
diff options
context:
space:
mode:
authorAxel Duch <axel.duch@nginx.com>2019-07-24 13:47:35 +0300
committerAxel Duch <axel.duch@nginx.com>2019-07-24 13:47:35 +0300
commit7785c96c1aea16dee0ec17403fda01b4f5ba41b3 (patch)
tree9abd736f0cfbfd6bea13685b1849ca4565dd1ce8 /src/nxt_h1proto.c
parentb1165d2edc99daf8eef0e092e4ed6dcee9bce252 (diff)
downloadunit-7785c96c1aea16dee0ec17403fda01b4f5ba41b3.tar.gz
unit-7785c96c1aea16dee0ec17403fda01b4f5ba41b3.tar.bz2
Added routing based on request scheme.
Scheme matches exact string “http” or “https”.
Diffstat (limited to 'src/nxt_h1proto.c')
-rw-r--r--src/nxt_h1proto.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/nxt_h1proto.c b/src/nxt_h1proto.c
index 3a822042..6bc6c7ee 100644
--- a/src/nxt_h1proto.c
+++ b/src/nxt_h1proto.c
@@ -35,7 +35,6 @@ 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,
@@ -104,13 +103,6 @@ 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,
@@ -448,6 +440,10 @@ nxt_h1p_conn_request_init(nxt_task_t *task, void *obj, void *data)
r->remote = c->remote;
+#if (NXT_TLS)
+ r->tls = c->u.tls;
+#endif
+
ret = nxt_http_parse_request_init(&h1p->parser, r->mem_pool);
if (nxt_fast_path(ret == NXT_OK)) {
@@ -821,15 +817,6 @@ 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)