feat: Enhance HttpHandler to manage response data dynamically and improve memory handling

This commit is contained in:
GW_MC
2026-02-03 19:26:42 +08:00
parent a008106d47
commit 0672a5fb74
2 changed files with 41 additions and 13 deletions

View File

@@ -41,6 +41,7 @@ public:
// only NetworkHandler can create HttpHandler instances
friend class NetworkHandler;
friend esp_err_t http_event_handler(esp_http_client_event_t *evt);
// disable copy constructor and assignment operator
HttpHandler(const HttpHandler&) = delete;
HttpHandler& operator=(const HttpHandler&) = delete;
@@ -52,4 +53,6 @@ private:
esp_http_client_handle_t client;
// backreference to WifiHandler to ensure WiFi is connected, DO NOT DELETE
WifiHandler* wifiHandler;
char* response_buffer;
size_t response_size;
};