mirror of
https://github.com/curl/curl.git
synced 2025-03-31 16:00:35 +08:00
mbedtls: fix "Logically dead code"
CID 1332128
This commit is contained in:
parent
4c62066cec
commit
f6ce8c9abb
@ -415,30 +415,25 @@ mbedtls_connect_step2(struct connectdata *conn,
|
||||
conn->send[sockindex] = mbedtls_send;
|
||||
|
||||
for(;;) {
|
||||
if(!(ret = mbedtls_ssl_handshake(&connssl->ssl)))
|
||||
ret = mbedtls_ssl_handshake(&connssl->ssl);
|
||||
if(!ret)
|
||||
break;
|
||||
if(ret == MBEDTLS_ERR_SSL_WANT_READ) {
|
||||
connssl->connecting_state = ssl_connect_2_reading;
|
||||
return CURLE_OK;
|
||||
}
|
||||
else if(ret == MBEDTLS_ERR_SSL_WANT_WRITE) {
|
||||
connssl->connecting_state = ssl_connect_2_writing;
|
||||
return CURLE_OK;
|
||||
}
|
||||
else if(ret != MBEDTLS_ERR_SSL_WANT_READ &&
|
||||
ret != MBEDTLS_ERR_SSL_WANT_WRITE) {
|
||||
#ifdef MBEDTLS_ERROR_C
|
||||
mbedtls_strerror(ret, errorbuf, sizeof(errorbuf));
|
||||
mbedtls_strerror(ret, errorbuf, sizeof(errorbuf));
|
||||
#endif /* MBEDTLS_ERROR_C */
|
||||
failf(data, "ssl_handshake returned - mbedTLS: (-0x%04X) %s",
|
||||
-ret, errorbuf);
|
||||
|
||||
return CURLE_SSL_CONNECT_ERROR;
|
||||
}
|
||||
else {
|
||||
if(ret == MBEDTLS_ERR_SSL_WANT_READ) {
|
||||
connssl->connecting_state = ssl_connect_2_reading;
|
||||
return CURLE_OK;
|
||||
}
|
||||
if(ret == MBEDTLS_ERR_SSL_WANT_WRITE) {
|
||||
connssl->connecting_state = ssl_connect_2_writing;
|
||||
return CURLE_OK;
|
||||
}
|
||||
failf(data, "SSL_connect failed with error %d.", ret);
|
||||
failf(data, "ssl_handshake returned - mbedTLS: (-0x%04X) %s",
|
||||
-ret, errorbuf);
|
||||
return CURLE_SSL_CONNECT_ERROR;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user