Address review: restore queue-full log, fix power-of-2 comment

- Add HELPER_LOG when overflow buffer is full and connection is dropped
- Clarify comment: defaults are power of 2 (not a requirement for users)
This commit is contained in:
J. Nick Koston
2026-03-16 13:09:41 -10:00
parent 61cc3022cb
commit 1ecbd28742
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -301,7 +301,7 @@ CONFIG_SCHEMA = cv.All(
# Maximum queued send buffers per connection before dropping connection
# Each buffer uses ~8-12 bytes overhead plus actual message size
# Platform defaults based on available RAM and typical message rates:
# CONF_MAX_SEND_QUEUE should be a power 2 for best performance
# CONF_MAX_SEND_QUEUE defaults are power of 2 for efficient modulo
cv.SplitDefault(
CONF_MAX_SEND_QUEUE,
esp8266=4, # Limited RAM, need to fail fast
@@ -150,6 +150,7 @@ APIError APIFrameHelper::write_raw_(const struct iovec *iov, int iovcnt, uint16_
// Queue unsent data into overflow buffer
if (!this->overflow_buf_.enqueue_iov(iov, iovcnt, total_write_len, skip)) {
HELPER_LOG("Overflow buffer full, dropping connection");
this->state_ = State::FAILED;
return APIError::SOCKET_WRITE_FAILED;
}