Skip to content

1mb cdr upload #92

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions ports/zephyr/common/memfault_platform_http.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,12 @@ static int prv_send_next_msg(sMemfaultHttpContext *ctx) {
memfault_http_start_chunk_post(prv_send_data, &sock, metadata.single_chunk_message_length);

while (1) {
uint8_t buf[128];
// Allow somehow a larger buffer for more efficient transfers
#if defined(CONFIG_MEMFAULT_HTTP_CHUNK_TRANSFER_BUFFER_SIZE)
uint8_t buf[CONFIG_MEMFAULT_HTTP_CHUNK_TRANSFER_BUFFER_SIZE];
#else
uint8_t buf[1024];
#endif
size_t buf_len = sizeof(buf);
eMemfaultPacketizerStatus status = memfault_packetizer_get_next(buf, &buf_len);
if (status == kMemfaultPacketizerStatus_NoMoreData) {
Expand Down Expand Up @@ -699,9 +704,8 @@ ssize_t memfault_zephyr_port_post_data_return_size(void) {
rv = memfault_zephyr_port_http_upload_sdk_data(&ctx);
}

if (rv == 0) {
memfault_zephyr_port_http_close_socket(&ctx);
}
// Always close the socket to prevent leaks
memfault_zephyr_port_http_close_socket(&ctx);

#if defined(CONFIG_MEMFAULT_METRICS_SYNC_SUCCESS)
if (rv == 0) {
Expand Down