mirror of https://github.com/ARMmbed/mbed-os.git
TLSSocket returns WOULD_BLOCK error instead of ALREADY
In case mbedtls fails to execute handshake advertising MBEDTLS_ERR_SSL_WANT_READ or MBEDTLS_ERR_SSL_WANT_WRITE, TLSSocketWrapper::continue_handshake returns NSAPI_ERROR_WOULD_BLOCK.pull/9584/head
parent
3d4582bda0
commit
9db97247a2
|
@ -287,7 +287,7 @@ nsapi_error_t TLSSocketWrapper::send(const void *data, nsapi_size_t size)
|
||||||
ret = continue_handshake();
|
ret = continue_handshake();
|
||||||
if (ret != NSAPI_ERROR_IS_CONNECTED) {
|
if (ret != NSAPI_ERROR_IS_CONNECTED) {
|
||||||
if (ret == NSAPI_ERROR_ALREADY) {
|
if (ret == NSAPI_ERROR_ALREADY) {
|
||||||
ret = NSAPI_ERROR_NO_CONNECTION;
|
ret = NSAPI_ERROR_WOULD_BLOCK;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -341,7 +341,7 @@ nsapi_size_or_error_t TLSSocketWrapper::recv(void *data, nsapi_size_t size)
|
||||||
ret = continue_handshake();
|
ret = continue_handshake();
|
||||||
if (ret != NSAPI_ERROR_IS_CONNECTED) {
|
if (ret != NSAPI_ERROR_IS_CONNECTED) {
|
||||||
if (ret == NSAPI_ERROR_ALREADY) {
|
if (ret == NSAPI_ERROR_ALREADY) {
|
||||||
ret = NSAPI_ERROR_NO_CONNECTION;
|
ret = NSAPI_ERROR_WOULD_BLOCK;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue