mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	Clean up RAMAllocators in http_request code (#9143)
This commit is contained in:
		| @@ -239,7 +239,7 @@ template<typename... Ts> class HttpRequestSendAction : public Action<Ts...> { | |||||||
|  |  | ||||||
|     std::string response_body; |     std::string response_body; | ||||||
|     if (this->capture_response_.value(x...)) { |     if (this->capture_response_.value(x...)) { | ||||||
|       ExternalRAMAllocator<uint8_t> allocator(ExternalRAMAllocator<uint8_t>::ALLOW_FAILURE); |       RAMAllocator<uint8_t> allocator; | ||||||
|       uint8_t *buf = allocator.allocate(max_length); |       uint8_t *buf = allocator.allocate(max_length); | ||||||
|       if (buf != nullptr) { |       if (buf != nullptr) { | ||||||
|         size_t read_index = 0; |         size_t read_index = 0; | ||||||
|   | |||||||
| @@ -54,7 +54,7 @@ void HttpRequestUpdate::update_task(void *params) { | |||||||
|     UPDATE_RETURN; |     UPDATE_RETURN; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   ExternalRAMAllocator<uint8_t> allocator(ExternalRAMAllocator<uint8_t>::ALLOW_FAILURE); |   RAMAllocator<uint8_t> allocator; | ||||||
|   uint8_t *data = allocator.allocate(container->content_length); |   uint8_t *data = allocator.allocate(container->content_length); | ||||||
|   if (data == nullptr) { |   if (data == nullptr) { | ||||||
|     std::string msg = str_sprintf("Failed to allocate %d bytes for manifest", container->content_length); |     std::string msg = str_sprintf("Failed to allocate %d bytes for manifest", container->content_length); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user