mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-11 16:40:17 +00:00
TLS layer: c->rtls to optimise recvd TLS data
This commit is contained in:
1 parent
98d877c5f0
commit
144c2f443e
12 files changed
+248
-120
No files matched your search
@@ -104,6 +104,7 @@ void mg_tls_init(struct mg_connection *c, const struct mg_tls_opts *opts) {
|
||||
}
|
||||
if (c->is_listening) goto fail;
|
||||
MG_DEBUG(("%lu Setting TLS", c->id));
|
||||
MG_PROF_ADD(c, "mbedtls_init_start");
|
||||
mbedtls_ssl_init(&tls->ssl);
|
||||
mbedtls_ssl_config_init(&tls->conf);
|
||||
mbedtls_x509_crt_init(&tls->ca);
|
||||
@@ -156,6 +157,7 @@ void mg_tls_init(struct mg_connection *c, const struct mg_tls_opts *opts) {
|
||||
c->is_tls = 1;
|
||||
c->is_tls_hs = 1;
|
||||
mbedtls_ssl_set_bio(&tls->ssl, c, mg_net_send, mg_net_recv, 0);
|
||||
MG_PROF_ADD(c, "mbedtls_init_end");
|
||||
if (c->is_client && c->is_resolving == 0 && c->is_connecting == 0) {
|
||||
mg_tls_handshake(c);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user