From 08739746f8aea353c08c5c0699c5ad7a8751da03 Mon Sep 17 00:00:00 2001 From: trilwu Date: Wed, 11 Mar 2026 09:20:55 +0700 Subject: [PATCH] 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) --- lib/KOReaderSync/KOReaderSyncClient.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/KOReaderSync/KOReaderSyncClient.cpp b/lib/KOReaderSync/KOReaderSyncClient.cpp index 26fa39d8..56827a87 100644 --- a/lib/KOReaderSync/KOReaderSyncClient.cpp +++ b/lib/KOReaderSync/KOReaderSyncClient.cpp @@ -47,6 +47,8 @@ esp_err_t httpEventHandler(esp_http_client_event_t* evt) { memcpy(buf->data + buf->len, evt->data, evt->data_len); buf->len += evt->data_len; buf->data[buf->len] = '\0'; + } else { + LOG_ERR("KOSync", "Response buffer allocation failed (%d bytes)", evt->data_len); } } return ESP_OK; @@ -73,7 +75,7 @@ std::string base64Encode(const std::string& input) { // Create configured esp_http_client with small TLS buffers 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 = {}; config.url = url; config.event_handler = httpEventHandler;