| 267 | } |
| 268 | |
| 269 | void UncompressedFile::dropOldData() { |
| 270 | /* mutex lock */ |
| 271 | std::lock_guard<std::mutex> lock(m_mutex); |
| 272 | |
| 273 | /* check if drop should be done now */ |
| 274 | if (m_data.empty()) { |
| 275 | return; |
| 276 | } |
| 277 | std::shared_ptr<LogContainer> logContainer = m_data.front(); |
| 278 | if (logContainer) { |
| 279 | std::streampos position = logContainer->uncompressedFileSize + logContainer->filePosition; |
| 280 | if ((position > m_tellg) || (position > m_tellp) || (position > m_fileSize)) { |
| 281 | /* don't drop yet */ |
| 282 | return; |
| 283 | } |
| 284 | } |
| 285 | |
| 286 | /* drop data */ |
| 287 | m_data.pop_front(); |
| 288 | } |
| 289 | |
| 290 | uint32_t UncompressedFile::defaultLogContainerSize() const { |
| 291 | /* mutex lock */ |
no test coverage detected