Skip to content

Commit

Permalink
Do not allow connection output buffer to exceed configured limit (#196)
Browse files Browse the repository at this point in the history
### Public-Facing Changes
- Do not allow connection output buffer to exceed configured limit

### Description
Makes sure that we only put messages in the output buffer if they do not
cause the output buffer to exceed the user configured limit.

This mitigates that larger messages (images / pointclouds, ...) prevent
smaller messages from being sent (see #174)
  • Loading branch information
achim-k authored Mar 13, 2023
1 parent c99ef97 commit 25992b0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ inline void Server<ServerConfiguration>::sendMessage(ConnHandle clientHandle, Ch
}

const auto bufferSizeinBytes = con->get_buffered_amount();
if (bufferSizeinBytes >= _options.sendBufferLimitBytes) {
if (bufferSizeinBytes + payloadSize >= _options.sendBufferLimitBytes) {
FOXGLOVE_DEBOUNCE(
[this]() {
_server.get_elog().write(
Expand Down

0 comments on commit 25992b0

Please sign in to comment.