Skip to content

Commit 969b26d

Browse files
committed
Apply some suggestions
Signed-off-by: Simone Orru <simone.orru@secomind.com>
1 parent 6c44ec7 commit 969b26d

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

lib/edgehog_device/file_transfer/download.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ static edgehog_result_t process_uncompressed_chunk(
281281
if (eres != EDGEHOG_RESULT_OK) {
282282
data->posix_errno = EIO;
283283
data->message = "Failed to write chunk to file";
284-
return EDGEHOG_RESULT_HTTP_REQUEST_ABORTED;
284+
return eres;
285285
}
286286

287287
// Stream the new chunk into the SHA-256 hash operation

lib/edgehog_device/include/file_transfer/utils.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
/** @brief HTTP request timeout duration in milliseconds. */
2424
#define EDGEHOG_FT_HTTP_REQ_TIMEOUT_MS (60 * 1000)
2525

26+
/** @brief Size for the output buffer used to temporarely store the compressed chunk. */
27+
#define EDGEHOG_FT_COMPRESSED_OUT_BUFFER_SIZE 1024
28+
2629
/** @brief Unified user data for HTTP callbacks. */
2730
typedef struct
2831
{
@@ -61,7 +64,7 @@ typedef struct
6164
/** @brief Compression context for outgoing uploaded files */
6265
file_transfer_compression_ctx_t comp_ctx;
6366
/** @brief Buffer used to hold the compressed output chunk during uploads */
64-
uint8_t comp_out_buf[1024];
67+
uint8_t comp_out_buf[EDGEHOG_FT_COMPRESSED_OUT_BUFFER_SIZE];
6568
/** @brief Track if the underlying file is fully read */
6669
bool file_exhausted;
6770
/** @brief Track if the LZ4 footer has been successfully written */

0 commit comments

Comments
 (0)