mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-26 20:38:25 +00:00
Unbreak MbedTLS (#3148), rollback debugging leftovers
This commit is contained in:
1 parent
305d69ee36
commit
0459d9e106
4 files changed
+4
-2
No files matched your search
@@ -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) {
|
void mg_tls_flush(struct mg_connection *c) {
|
||||||
|
struct mg_tls *tls = (struct mg_tls *) c->tls;
|
||||||
if (c->is_tls_throttled) {
|
if (c->is_tls_throttled) {
|
||||||
long n = mbedtls_ssl_write(&tls->ssl, tls->throttled_buf, tls->throttled_len);
|
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);
|
c->is_tls_throttled = (n == MBEDTLS_ERR_SSL_WANT_READ || n == MBEDTLS_ERR_SSL_WANT_WRITE);
|
||||||
|
|||||||
@@ -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) {
|
void mg_tls_flush(struct mg_connection *c) {
|
||||||
|
struct mg_tls *tls = (struct mg_tls *) c->tls;
|
||||||
if (c->is_tls_throttled) {
|
if (c->is_tls_throttled) {
|
||||||
long n = mbedtls_ssl_write(&tls->ssl, tls->throttled_buf, tls->throttled_len);
|
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);
|
c->is_tls_throttled = (n == MBEDTLS_ERR_SSL_WANT_READ || n == MBEDTLS_ERR_SSL_WANT_WRITE);
|
||||||
|
|||||||
@@ -254,6 +254,6 @@ void web_init(struct mg_mgr *mgr) {
|
|||||||
s_settings.device_name = strdup("My Device");
|
s_settings.device_name = strdup("My Device");
|
||||||
mg_http_listen(mgr, HTTP_URL, fn, NULL);
|
mg_http_listen(mgr, HTTP_URL, fn, NULL);
|
||||||
mg_http_listen(mgr, HTTPS_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);
|
timer_sntp_fn, mgr);
|
||||||
}
|
}
|
||||||
@@ -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_driver driver = {.tx = tap_tx, .poll = tap_poll, .rx = tap_rx};
|
||||||
struct mg_tcpip_if mif = {.driver = &driver,
|
struct mg_tcpip_if mif = {.driver = &driver,
|
||||||
.driver_data = &fd,
|
.driver_data = &fd,
|
||||||
.enable_req_dns = false,
|
.enable_req_dns = true,
|
||||||
.enable_req_sntp = true,
|
.enable_req_sntp = true,
|
||||||
.fn = mif_fn};
|
.fn = mif_fn};
|
||||||
sscanf(mac, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", &mif.mac[0], &mif.mac[1],
|
sscanf(mac, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", &mif.mac[0], &mif.mac[1],
|
||||||
|
|||||||
Reference in new issue
Block a user