Skip to content

Commit c78c814

Browse files
committed
refactor(ssl_client): Constexpr chunk size; rename max_write_chunk_size
1 parent 010e6a0 commit c78c814

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libraries/NetworkClientSecure/src/ssl_client.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -413,14 +413,14 @@ int send_ssl_data(sslclient_context *ssl_client, const uint8_t *data, size_t len
413413
return 0; // Skipping zero-length write
414414
}
415415

416-
const size_t kChunk = 4096;
416+
static constexpr size_t max_write_chunk_size = 4096;
417417
unsigned long last_progress = millis(); // Timeout since last progress
418418
size_t sent = 0;
419419

420420
while (sent < len) {
421421
size_t to_send = len - sent;
422-
if (to_send > kChunk) {
423-
to_send = kChunk;
422+
if (to_send > max_write_chunk_size) {
423+
to_send = max_write_chunk_size;
424424
}
425425

426426
int ret = mbedtls_ssl_write(&ssl_client->ssl_ctx, data + sent, to_send);

0 commit comments

Comments
 (0)