From 0459d9e106c4908d21198744c677a582aa7c8f52 Mon Sep 17 00:00:00 2001 From: "Sergio R. Caprile" Date: Wed, 4 Jun 2025 08:56:01 -0300 Subject: [PATCH] Unbreak MbedTLS (#3148), rollback debugging leftovers --- mongoose.c | 1 + src/tls_mbed.c | 1 + tutorials/http/device-dashboard/net.c | 2 +- tutorials/tcpip/tap-driver/main.c | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mongoose.c b/mongoose.c index b8d0bde2..c49e0d8b 100644 --- a/mongoose.c +++ b/mongoose.c @@ -14194,6 +14194,7 @@ long mg_tls_send(struct mg_connection *c, const void *buf, size_t len) { } void mg_tls_flush(struct mg_connection *c) { + struct mg_tls *tls = (struct mg_tls *) c->tls; if (c->is_tls_throttled) { long n = mbedtls_ssl_write(&tls->ssl, tls->throttled_buf, tls->throttled_len); c->is_tls_throttled = (n == MBEDTLS_ERR_SSL_WANT_READ || n == MBEDTLS_ERR_SSL_WANT_WRITE); diff --git a/src/tls_mbed.c b/src/tls_mbed.c index b1ef337f..17475c31 100644 --- a/src/tls_mbed.c +++ b/src/tls_mbed.c @@ -210,6 +210,7 @@ long mg_tls_send(struct mg_connection *c, const void *buf, size_t len) { } void mg_tls_flush(struct mg_connection *c) { + struct mg_tls *tls = (struct mg_tls *) c->tls; if (c->is_tls_throttled) { long n = mbedtls_ssl_write(&tls->ssl, tls->throttled_buf, tls->throttled_len); c->is_tls_throttled = (n == MBEDTLS_ERR_SSL_WANT_READ || n == MBEDTLS_ERR_SSL_WANT_WRITE); diff --git a/tutorials/http/device-dashboard/net.c b/tutorials/http/device-dashboard/net.c index baed248e..d47daae7 100644 --- a/tutorials/http/device-dashboard/net.c +++ b/tutorials/http/device-dashboard/net.c @@ -254,6 +254,6 @@ void web_init(struct mg_mgr *mgr) { s_settings.device_name = strdup("My Device"); mg_http_listen(mgr, HTTP_URL, fn, NULL); mg_http_listen(mgr, HTTPS_URL, fn, NULL); - mg_timer_add(mgr, 10 * 1000, MG_TIMER_RUN_NOW | MG_TIMER_REPEAT, + mg_timer_add(mgr, 3600 * 1000, MG_TIMER_RUN_NOW | MG_TIMER_REPEAT, timer_sntp_fn, mgr); } diff --git a/tutorials/tcpip/tap-driver/main.c b/tutorials/tcpip/tap-driver/main.c index 72fb58db..008ae9a3 100644 --- a/tutorials/tcpip/tap-driver/main.c +++ b/tutorials/tcpip/tap-driver/main.c @@ -112,7 +112,7 @@ int main(int argc, char *argv[]) { struct mg_tcpip_driver driver = {.tx = tap_tx, .poll = tap_poll, .rx = tap_rx}; struct mg_tcpip_if mif = {.driver = &driver, .driver_data = &fd, - .enable_req_dns = false, + .enable_req_dns = true, .enable_req_sntp = true, .fn = mif_fn}; sscanf(mac, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", &mif.mac[0], &mif.mac[1],