Skip to content

Commit

Permalink
Important fix for memory leaks issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
mobizt committed May 6, 2022
1 parent 6551421 commit cfa763c
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions src/wcs/base/ESP_Signer_TCP_Client_Base.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* TCP Client Base class, version 1.0.2
* ESP Signer TCP Client base v1.0.0
*
* Created February 28, 2022
* Created May 6, 2022
*
* The MIT License (MIT)
* Copyright (c) 2022 K. Suwatchai (Mobizt)
Expand Down
24 changes: 12 additions & 12 deletions src/wcs/esp32/ESP_Signer_TCP_Client.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Firebase TCP Client v1.1.19
* ESP Signer TCP Client v1.0.0
*
* Created February 20, 2022
* Created May 6, 2022
*
* The MIT License (MIT)
* Copyright (c) 2022 K. Suwatchai (Mobizt)
Expand Down Expand Up @@ -63,15 +63,15 @@ void ESP_Signer_TCP_Client::setCACert(const char *caCert)

if (caCert != NULL)
{
baseSetCertType(ESP_Signer_cert_type_data);
baseSetCertType(esp_signer_cert_type_data);
wcs->setCACert(caCert);
}
else
{
wcs->stop();
wcs->setCACert(NULL);
setInsecure();
baseSetCertType(ESP_Signer_cert_type_none);
baseSetCertType(esp_signer_cert_type_none);
}
}

Expand All @@ -98,7 +98,7 @@ bool ESP_Signer_TCP_Client::setCertFile(const char *caCertFile, mb_fs_mem_storag
fs::File file = mbfs->getFlashFile();
wcs->loadCACert(file, len);
mbfs->close(storageType);
baseSetCertType(ESP_Signer_cert_type_file);
baseSetCertType(esp_signer_cert_type_file);
}
else if (storageType == mb_fs_mem_storage_type_sd)
{
Expand All @@ -114,20 +114,20 @@ bool ESP_Signer_TCP_Client::setCertFile(const char *caCertFile, mb_fs_mem_storag

mbfs->close(storageType);
wcs->setCACert((const char *)cert);
baseSetCertType(ESP_Signer_cert_type_file);
baseSetCertType(esp_signer_cert_type_file);

#elif defined(MBFS_SD_FS)
fs::File file = mbfs->getSDFile();
wcs->loadCACert(file, len);
mbfs->close(storageType);
baseSetCertType(ESP_Signer_cert_type_file);
baseSetCertType(esp_signer_cert_type_file);

#endif
}
}
}

return getCertType() == ESP_Signer_cert_type_file;
return getCertType() == esp_signer_cert_type_file;
}

bool ESP_Signer_TCP_Client::networkReady()
Expand All @@ -145,9 +145,9 @@ void ESP_Signer_TCP_Client::networkDisconnect()
WiFi.disconnect();
}

ESP_Signer_tcp_client_type ESP_Signer_TCP_Client::type()
esp_signer_tcp_client_type ESP_Signer_TCP_Client::type()
{
return ESP_Signer_tcp_client_type_internal;
return esp_signer_tcp_client_type_internal;
}

bool ESP_Signer_TCP_Client::isInitialized() { return true; }
Expand Down Expand Up @@ -185,7 +185,7 @@ bool ESP_Signer_TCP_Client::connect()
wcs->setTimeout(timeoutMs);

if (!wcs->_connect(host.c_str(), port, timeoutMs))
return setError(ESP_Signer_ERROR_TCP_ERROR_CONNECTION_REFUSED);
return setError(ESP_SIGNER_ERROR_TCP_ERROR_CONNECTION_REFUSED);

return connected();
}
Expand All @@ -211,7 +211,7 @@ void ESP_Signer_TCP_Client::release()
if (cert)
mbfs->delP(&cert);

baseSetCertType(ESP_Signer_cert_type_undefined);
baseSetCertType(esp_signer_cert_type_undefined);
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/wcs/esp32/ESP_Signer_TCP_Client.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Firebase TCP Client v1.1.19
* ESP Signer TCP Client v1.0.0
*
* Created February 20, 2022
* Created May 6, 2022
*
* The MIT License (MIT)
* Copyright (c) 2022 K. Suwatchai (Mobizt)
Expand Down Expand Up @@ -85,7 +85,7 @@ class ESP_Signer_TCP_Client : public ESP_Signer_TCP_Client_Base

void networkDisconnect();

ESP_Signer_tcp_client_type type();
esp_signer_tcp_client_type type();

bool isInitialized();

Expand Down
4 changes: 2 additions & 2 deletions src/wcs/esp8266/ESP_Signer_TCP_Client.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Firebase TCP Client v1.1.20
* ESP Signer TCP Client v1.0.0
*
* Created April 17, 2022
* Created May 6, 2022
*
* The MIT License (MIT)
* Copyright (c) 2022 K. Suwatchai (Mobizt)
Expand Down
4 changes: 2 additions & 2 deletions src/wcs/esp8266/ESP_Signer_TCP_Client.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Firebase TCP Client v1.1.20
* ESP Signer TCP Client v1.0.0
*
* Created April 17, 2022
* Created May 6, 2022
*
* The MIT License (MIT)
* Copyright (c) 2022 K. Suwatchai (Mobizt)
Expand Down

0 comments on commit cfa763c

Please sign in to comment.