Skip to content

Commit

Permalink
check for capacity exceeded more defensively
Browse files Browse the repository at this point in the history
  • Loading branch information
KodrAus committed Feb 6, 2019
1 parent d7e1b2d commit b0048ff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion sqelf/src/receive.rs
Expand Up @@ -180,7 +180,9 @@ impl Gelf {

fn gc(&mut self) -> Result<(), Error> {
// Check the capacity of the incomplete chunk list
if self.by_id.chunks.len() == self.config.incomplete_capacity {
// If we're past the threshold then drop *all* chunks,
// whether they've expired or not.
if self.by_id.chunks.len() >= self.config.incomplete_capacity {
self.by_id.chunks.clear();
self.by_arrival.chunks.clear();
}
Expand Down

0 comments on commit b0048ff

Please sign in to comment.