Skip to content

Commit

Permalink
extmod/modussl_mbedtls: Poll EVENT_POLL_HOOK in ssl handshake loop.
Browse files Browse the repository at this point in the history
Otherwise this is essentially an infinite loop on ports that do not use
interrupts to service network interfaces.

Signed-off-by: Andrew Leech <andrew@alelec.net>
  • Loading branch information
andrewleech authored and dpgeorge committed Jun 3, 2022
1 parent ffe5f2e commit 4188bbd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions extmod/modussl_mbedtls.c
Expand Up @@ -242,6 +242,9 @@ STATIC mp_obj_ssl_socket_t *socket_new(mp_obj_t sock, struct ssl_args *args) {
if (ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE) {
goto cleanup;
}
#ifdef MICROPY_EVENT_POLL_HOOK
MICROPY_EVENT_POLL_HOOK
#endif
}
}

Expand Down

0 comments on commit 4188bbd

Please sign in to comment.