interface added and web ui created
This commit is contained in:
@@ -114,7 +114,19 @@ public:
|
||||
ReadFromBuffer(&tempRead, &tempSize, 4);
|
||||
|
||||
if (tempSize > maxSize) {
|
||||
readIndex = write;
|
||||
// FIX #5: Skip only the current entry rather than discarding the
|
||||
// entire ring buffer. tempRead is already past the 16-byte header;
|
||||
// advancing by tempSize lands at the start of the next entry.
|
||||
//
|
||||
// Safety fallback: if tempSize >= bufferSize the stored size field
|
||||
// is corrupt (it can never be that large). In that case we cannot
|
||||
// locate the next entry safely, so fall back to discarding everything
|
||||
// to avoid reading garbage as sample headers on future Pop() calls.
|
||||
if (tempSize >= bufferSize) {
|
||||
readIndex = write; // corrupt ring — discard all
|
||||
} else {
|
||||
readIndex = (tempRead + tempSize) % bufferSize;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user