summaryrefslogtreecommitdiffhomepage
path: root/src/go
diff options
context:
space:
mode:
authorAndrei Belov <defan@nginx.com>2019-05-30 17:44:29 +0300
committerAndrei Belov <defan@nginx.com>2019-05-30 17:44:29 +0300
commit4921df052be8437d912f3c60faa9a667890e4498 (patch)
tree3678c551f148a0d177721597de978c090237f205 /src/go
parent3b7a7ff2aa5840d4238584410ee1ebc6860fb9c5 (diff)
parent7da320a93af07765e79c929287704936c431f3cd (diff)
downloadunit-4921df052be8437d912f3c60faa9a667890e4498.tar.gz
unit-4921df052be8437d912f3c60faa9a667890e4498.tar.bz2
Merged with the default branch.1.9.0-1
Diffstat (limited to 'src/go')
-rw-r--r--src/go/unit/nxt_cgo_lib.c4
-rw-r--r--src/go/unit/request.go7
2 files changed, 11 insertions, 0 deletions
diff --git a/src/go/unit/nxt_cgo_lib.c b/src/go/unit/nxt_cgo_lib.c
index 98a23482..cc1228f5 100644
--- a/src/go/unit/nxt_cgo_lib.c
+++ b/src/go/unit/nxt_cgo_lib.c
@@ -83,6 +83,10 @@ nxt_cgo_request_handler(nxt_unit_request_info_t *req)
nxt_go_request_set_remote_addr(go_req,
nxt_cgo_str_init(&remote_addr, &r->remote, r->remote_length));
+ if (r->tls) {
+ nxt_go_request_set_tls(go_req);
+ }
+
nxt_go_request_handler(go_req, (uintptr_t) req->unit->data);
}
diff --git a/src/go/unit/request.go b/src/go/unit/request.go
index 829a2c64..ad56cabb 100644
--- a/src/go/unit/request.go
+++ b/src/go/unit/request.go
@@ -14,6 +14,7 @@ import (
"io"
"net/http"
"net/url"
+ "crypto/tls"
"unsafe"
)
@@ -125,6 +126,12 @@ func nxt_go_request_set_remote_addr(go_req uintptr, addr *C.nxt_cgo_str_t) {
get_request(go_req).req.RemoteAddr = C.GoStringN(addr.start, addr.length)
}
+//export nxt_go_request_set_tls
+func nxt_go_request_set_tls(go_req uintptr) {
+
+ get_request(go_req).req.TLS = &tls.ConnectionState{ }
+}
+
//export nxt_go_request_handler
func nxt_go_request_handler(go_req uintptr, h uintptr) {
r := get_request(go_req)