2.0.20~6
Features
- Add support for linux build (58380585)
Bug Fixes
- Fix mosquitto build on latest master (ebc1258e)
- Fix build with the new picolibc (dc68bf87)
1.6.1
Bug Fixes
- Fix race conditions, memory leak, and data loss (23ca97d5)
- Add state check in abort_connection to prevent double-close
- Fix memory leak: free errormsg_buffer on disconnect
- Reset connection state on reconnect to prevent stale data
- Implement lock ordering for separate TX lock mode
- Read buffered data immediately after connection to prevent data loss
- Added sdkconfig.ci.tx_lock config
asio::ssl::stream leaks a significant amount (>20KB) of memory over its
lifetime.
asio::ssl::mbedtls::engine::impl has these members ...
mbedtls_ssl_context ssl_{};
mbedtls_entropy_context entropy_{};
mbedtls_ctr_drbg_context ctr_drbg_{};
mbedtls_ssl_config conf_{};
mbedtls_x509_crt public_cert_{};
mbedtls_pk_context pk_key_{};
mbedtls_x509_crt ca_cert_{};
... which are properly init'ed in its constructor ...
mbedtls_ssl_init(&ssl_);
mbedtls_ssl_config_init(&conf_);
mbedtls_ctr_drbg_init(&ctr_drbg_);
mbedtls_entropy_init(&entropy_);
mbedtls_x509_crt_init(&public_cert_);
mbedtls_pk_init(&pk_key_);
mbedtls_x509_crt_init(&ca_cert_);
... but are never free'd ... until now
~impl()
{
mbedtls_x509_crt_free(&ca_cert_);
mbedtls_pk_free(&pk_key_);
mbedtls_x509_crt_free(&public_cert_);
mbedtls_entropy_free(&entropy_);
mbedtls_ctr_drbg_free(&ctr_drbg_);
mbedtls_ssl_config_free(&conf_);
mbedtls_ssl_free(&ssl_);
}
asio::ssl::mbedtls::engine::impl::configure calls ...
mbedtls_x509_crt_init(&public_cert_);
mbedtls_pk_init(&pk_key_);
mbedtls_x509_crt_init(&ca_cert_);
... again without first free'ing any resources that might be held by such.
now this is done first:
mbedtls_x509_crt_free(&ca_cert_);
mbedtls_pk_free(&pk_key_);
mbedtls_x509_crt_free(&public_cert_);
asio::ssl::engine has this member
std::pair<std::shared_ptr<bio>, std::shared_ptr<bio>> bio_;
which is made in its constructor
explicit engine(std::shared_ptr<context> ctx): ctx_(std::move(ctx)),
bio_(bio::new_pair("mbedtls-engine")), state_(IDLE), verify_mode_(0) {}
asio::ssl::mbedtls::bio::new_pair creates a cyclic reference between its
paired elements
static std::pair<std::shared_ptr<bio>, std::shared_ptr<bio>> new_pair(const char *error_location)
{
auto b1 = std::shared_ptr<bio>(new (std::nothrow) bio);
auto b2 = std::shared_ptr<bio>(new (std::nothrow) bio);
if (b1 == nullptr || b2 == nullptr) {
throw_alloc_failure(error_location);
} else {
b1->peer_ = b2;
b2->peer_ = b1;
}
return std::make_pair(b1, b2);
}
there is no asio::ssl::engine destructor to untie this cycle so when the
pair member is destroyed, its elements will leak.
a destructor is needed to fix this ...
~engine()
{
bio::untie_pair(bio_);
}
... along with untie_pair ...
// untie cyclic shared_ptr references made by new_pair in preparation for destruction
static void untie_pair(std::pair<std::shared_ptr<bio>, std::shared_ptr<bio>>& pair)
{
if (pair.first) {
pair.first->peer_.reset();
}
if (pair.second) {
pair.second->peer_.reset();
}
}
- Add state check in abort_connection to prevent double-close
- Fix memory leak: free errormsg_buffer on disconnect
- Reset connection state on reconnect to prevent stale data
- Implement lock ordering for separate TX lock mode
- Read buffered data immediately after connection to prevent data loss
- Added sdkconfig.ci.tx_lock config
0.5.0
Bug Fixes
- Implement simple unit tests (f41c4a0a)
- Fix to construct in two steps (d979e1b3, #631)
- Add explicit dependency on esp-mqtt if needed (3d5e11b8)
The MDNS component has been refactored from a single monolithic file mdns.c
into a set of focused modules with clear responsibilities.
This restructuring maintains the same functionality while improving code organization,
maintainability, and testability.
In the stage#2 we will focus on module based tests
In the stage#3 we will focus on small scale refators and optimizations
2.0.20~5
Features
- Add support for basic MQTT authentication (65b58aa0)
Bug Fixes
- Add optional mqtt deps to examples (6f6110e3)
- Update example to optionally use basic mqtt auth (38384852)
- Fix unpwd-check wrap function (ba3377b2)
- Fix the version check (9fbb6e6d)
2.0.0
Breaking changes
- inc headers for AT command definitions are no longer used directly, but pregenerated into *.h(pp) (Use generated AT command definitions for IDE navigation)
Features
- Add support for multiple connection in AT based example (2826287d)
- Add enhanced URC observer API (4889dd6f)
- Support esp-modem use without PPP (858f8570, #851)
- Modem simulator based on esp-at (e5787e3d)
Bug Fixes
- Update tests and examples to use modem-v2.0 (4aa0e4ba)
- Replace MQTT client with simple ping command (0ccaf2c0)
- Replace MQTT client with simple ping command (9b2b1f68)
- Update example to use optional mqtt deps (3141d6ca)
- Minor fixed in the test code (e772ce67)
- Add missing set_echo() C wrapper (d1e67080, #926)
- Fix modem console dependencies (453be4cd)
- Address build issues (018ba58e)
- Fix driver dependency issue on v6.0 (67c682d9)
- Fix CI build issues with IDFv6.0 (15140e04)
- Add support for ESP-AT based tcp-client example (14d3cb6b)
- Use idf-build-apps for building target tests (e9d9b3a8)
- Make MQTT public broker endpoint configurable (6d541194)
- Fix URC handling in DTE data callback (93029946)
- Use another public broker for examples and tests (fac2edbe)
- Fix incompatible iterator in std::search() in new gcc (ed0f6334)
- Fix autodetect to support ACFC mode in PPP frames (8b328a69, #801)
- Fix get_network_registration_state() to accept two params (5f54d907, #826)
- Consume buffer after handled URC (6eceb28f)
- Use generated AT command definitions for IDE navigation (e2fa1110, !BREAKING)