mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-06 15:51:25 +00:00
Get rid of mg_*asprintf
This commit is contained in:
1 parent
ccf5364187
commit
d76f86f7db
13 files changed
+88
-244
No files matched your search
+3
-5
@@ -145,11 +145,9 @@ void mg_tls_init(struct mg_connection *c, const struct mg_tls_opts *opts) {
|
||||
mbedtls_ssl_conf_ca_chain(&tls->conf, &tls->ca, NULL);
|
||||
#endif
|
||||
if (opts->srvname.len > 0) {
|
||||
char mem[128], *buf = mem;
|
||||
mg_asprintf(&buf, sizeof(mem), "%.*s", (int) opts->srvname.len,
|
||||
opts->srvname.ptr);
|
||||
mbedtls_ssl_set_hostname(&tls->ssl, buf);
|
||||
if (buf != mem) free(buf);
|
||||
char *x = mg_mprintf("%.*s", (int) opts->srvname.len, opts->srvname.ptr);
|
||||
mbedtls_ssl_set_hostname(&tls->ssl, x);
|
||||
free(x);
|
||||
}
|
||||
mbedtls_ssl_conf_authmode(&tls->conf, MBEDTLS_SSL_VERIFY_REQUIRED);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user