style: fix clang-format alignment and log allocation failure
Address CI clang-format check and CodeRabbit review feedback: - Fix parameter alignment (one extra space) - Log warning when response buffer allocation fails (cherry picked from commit 3900ea1feb017c07bd5e38da0b471fe623ec506e)
This commit is contained in:
@@ -47,6 +47,8 @@ esp_err_t httpEventHandler(esp_http_client_event_t* evt) {
|
|||||||
memcpy(buf->data + buf->len, evt->data, evt->data_len);
|
memcpy(buf->data + buf->len, evt->data, evt->data_len);
|
||||||
buf->len += evt->data_len;
|
buf->len += evt->data_len;
|
||||||
buf->data[buf->len] = '\0';
|
buf->data[buf->len] = '\0';
|
||||||
|
} else {
|
||||||
|
LOG_ERR("KOSync", "Response buffer allocation failed (%d bytes)", evt->data_len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
@@ -73,7 +75,7 @@ std::string base64Encode(const std::string& input) {
|
|||||||
|
|
||||||
// Create configured esp_http_client with small TLS buffers
|
// Create configured esp_http_client with small TLS buffers
|
||||||
esp_http_client_handle_t createClient(const char* url, ResponseBuffer* buf,
|
esp_http_client_handle_t createClient(const char* url, ResponseBuffer* buf,
|
||||||
esp_http_client_method_t method = HTTP_METHOD_GET) {
|
esp_http_client_method_t method = HTTP_METHOD_GET) {
|
||||||
esp_http_client_config_t config = {};
|
esp_http_client_config_t config = {};
|
||||||
config.url = url;
|
config.url = url;
|
||||||
config.event_handler = httpEventHandler;
|
config.event_handler = httpEventHandler;
|
||||||
|
|||||||
Reference in New Issue
Block a user