diff options
author | Thorsten von Eicken <tve@voneicken.com> | 2020-04-02 10:01:16 -0700 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2021-02-17 11:50:54 +1100 |
commit | 2c1299b0071c2c528cc01e3cde9eb22743820176 (patch) | |
tree | 0679eb4daf9522f30cec65b3d7bce494029482b9 /extmod/modussl_mbedtls.c | |
parent | 2eed9780ba7074de9e464a2bc771ad14f0332a6c (diff) |
extmod/modussl: Fix ussl read/recv/send/write errors when non-blocking.
Also fix related problems with socket on esp32, improve docs for
wrap_socket, and add more tests.
Diffstat (limited to 'extmod/modussl_mbedtls.c')
-rw-r--r-- | extmod/modussl_mbedtls.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/extmod/modussl_mbedtls.c b/extmod/modussl_mbedtls.c index 1677dc6e1..277af37c7 100644 --- a/extmod/modussl_mbedtls.c +++ b/extmod/modussl_mbedtls.c @@ -133,6 +133,7 @@ STATIC int _mbedtls_ssl_send(void *ctx, const byte *buf, size_t len) { } } +// _mbedtls_ssl_recv is called by mbedtls to receive bytes from the underlying socket STATIC int _mbedtls_ssl_recv(void *ctx, byte *buf, size_t len) { mp_obj_t sock = *(mp_obj_t *)ctx; @@ -171,7 +172,7 @@ STATIC mp_obj_ssl_socket_t *socket_new(mp_obj_t sock, struct ssl_args *args) { mbedtls_pk_init(&o->pkey); mbedtls_ctr_drbg_init(&o->ctr_drbg); #ifdef MBEDTLS_DEBUG_C - // Debug level (0-4) + // Debug level (0-4) 1=warning, 2=info, 3=debug, 4=verbose mbedtls_debug_set_threshold(0); #endif |