Remove check for would_block in mbedtls
Basically, in the portability layer, it is checked if the socket is NON-block, and if not, then even the EAGAIN and EWOULDBLOCK errors are diverted to a RECV error. This causes a problem for sockets with receive timeouts set. When such a timeout is set, the condition for NON_BLOCK isn't met and hence a hard error is returned. Searching for EAGAIN and EWOULDBLOCK in lwip returns only 3 results (accept, recvfrom, close) and all of them look to be genuine cases for EWOULDBLOCK. So removing this check to make receive timeout with TLS work.
This commit is contained in:
parent
f819b7da90
commit
700976f709
1 changed files with 0 additions and 7 deletions
|
@ -210,13 +210,6 @@ static int net_would_block( const mbedtls_net_context *ctx, int *errout )
|
||||||
*errout = error;
|
*errout = error;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Never return 'WOULD BLOCK' on a non-blocking socket
|
|
||||||
*/
|
|
||||||
if ( ( fcntl( ctx->fd, F_GETFL, 0) & O_NONBLOCK ) != O_NONBLOCK ) {
|
|
||||||
return ( 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
switch ( error ) {
|
switch ( error ) {
|
||||||
#if defined EAGAIN
|
#if defined EAGAIN
|
||||||
case EAGAIN:
|
case EAGAIN:
|
||||||
|
|
Loading…
Reference in a new issue