From 478d3f2aa08f6d4c1b7167d1e949c58b64317166 Mon Sep 17 00:00:00 2001 From: Carlos Chinchilla Date: Tue, 7 Sep 2021 16:36:22 -0700 Subject: pw_ring_buffer: Crash on corrupt buffer access Crash when accessing a corrupt ring buffer since there is no general way to recover and corrupt data is indicative of other major memory issues. Remove user's expectancy of DataLoss errors and documentation in comments and update comments where necessary. Remove unused iterator class and status. Change-Id: I75e64ceb17dd7013461f4034d1cfa13090017e64 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/59040 Reviewed-by: Ewout van Bekkum Pigweed-Auto-Submit: Carlos Chinchilla Commit-Queue: Auto-Submit --- pw_log_rpc/rpc_log_drain.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'pw_log_rpc') diff --git a/pw_log_rpc/rpc_log_drain.cc b/pw_log_rpc/rpc_log_drain.cc index 385b9e0dd..6c21286b4 100644 --- a/pw_log_rpc/rpc_log_drain.cc +++ b/pw_log_rpc/rpc_log_drain.cc @@ -87,8 +87,7 @@ RpcLogDrain::LogDrainState RpcLogDrain::EncodeOutgoingPacket( uint32_t drop_count = 0; Result possible_entry = PeekEntry(log_entry_buffer_, drop_count); - if (possible_entry.status().IsResourceExhausted() || - possible_entry.status().IsDataLoss()) { + if (possible_entry.status().IsResourceExhausted()) { continue; } -- cgit v1.2.3