Improvements & fixes (#589)

This commit is contained in:
Ken Van Hoeylandt
2026-07-26 21:26:52 +02:00
committed by GitHub
parent b98a813f3c
commit f21c0df6fe
12 changed files with 143 additions and 29 deletions
+2 -2
View File
@@ -200,10 +200,10 @@ size_t receiveFile(httpd_req_t* request, size_t length, const std::string& fileP
auto expected_chunk_size = std::min<size_t>(BUFFER_SIZE, length - bytes_received);
size_t receive_chunk_size = httpd_req_recv(request, buffer, expected_chunk_size);
if (receive_chunk_size <= 0) {
LOG_E(TAG, "Receive failed");
LOG_E(TAG, "Receive failed, got 0 bytes but expected %zu more", length - bytes_received);
break;
}
if (fwrite(buffer, 1, receive_chunk_size, file) != (size_t)receive_chunk_size) {
if (fwrite(buffer, 1, receive_chunk_size, file) != receive_chunk_size) {
LOG_E(TAG, "Failed to write all bytes");
break;
}