fix: https and first ota process
This commit is contained in:
@ -74,19 +74,17 @@ https_client_ret_t https_clientRetrieveData(char* pu8Data, uint32_t* pu32DataLen
|
||||
int32_t i32RetRetrieveData = ESP_OK;
|
||||
bzero(pu8Data, *pu32DataLenght);
|
||||
bool bRetriveData = true;
|
||||
*pu32BytesRead = 0U;
|
||||
|
||||
while (bRetriveData)
|
||||
{
|
||||
//Reading HTTP response
|
||||
i32RetRetrieveData = mbedtls_ssl_read(&sHTTPS_ClientConfig.ssl, (unsigned char *)pu8Data, *pu32DataLenght);
|
||||
i32RetRetrieveData = mbedtls_ssl_read(&sHTTPS_ClientConfig.ssl, (unsigned char *)(pu8Data+(*pu32BytesRead)), ((*pu32DataLenght)-(*pu32BytesRead)));
|
||||
|
||||
printf("HTTPSread: %i\n", i32RetRetrieveData);
|
||||
|
||||
if(i32RetRetrieveData > 0)
|
||||
{
|
||||
//Data received
|
||||
*pu32BytesRead = *pu32BytesRead + i32RetRetrieveData;
|
||||
*pu32DataLenght = *pu32DataLenght - *pu32BytesRead;
|
||||
|
||||
if(*pu32DataLenght > 0)
|
||||
{
|
||||
@ -106,10 +104,6 @@ https_client_ret_t https_clientRetrieveData(char* pu8Data, uint32_t* pu32DataLen
|
||||
bRetriveData = false;
|
||||
pu32BytesRead = 0;
|
||||
|
||||
printf("finished HTTPSread: %i\n", i32RetRetrieveData);
|
||||
|
||||
while(1){}
|
||||
|
||||
}
|
||||
|
||||
if(i32RetRetrieveData == MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY)
|
||||
|
Reference in New Issue
Block a user