]> granicus.if.org Git - esp-idf/commit
mbedtls port: Fix detection of EWOULDBLOCK/EAGAIN with non-blocking sockets
authorMichael Kellner <mkellner@intlweb.com>
Tue, 11 Apr 2017 20:08:35 +0000 (13:08 -0700)
committerAngus Gratton <gus@projectgus.com>
Fri, 21 Apr 2017 00:46:34 +0000 (10:46 +1000)
commita523aa3ef538da39334d1c6a1819ec19e57dcc9e
treef795685b7eb355e47695614e3ff62de1c52aa7e4
parent793003d0fae6a7343d3b56246a62f49789cd3c68
mbedtls port: Fix detection of EWOULDBLOCK/EAGAIN with non-blocking sockets

Since mbedtls_net_errno is reset by fcntl, it is reset after calling
net_would_block, so the call to mbedtls_net_errno in mbedtls_net_recv
and mbedtls_net_send will always get back 0. This change propagates
the value returned by mbedtls_net_errno up through net_would_block,
to allow the correct error value to be used and avoid a redundant
call to mbedtls_net_errno.

Merges PR #511 https://github.com/espressif/esp-idf/pull/511
components/mbedtls/port/net.c