| 296 | } |
| 297 | |
| 298 | bool |
| 299 | Config::canLogError() |
| 300 | { |
| 301 | if (m_paceerrsecs < 0) { |
| 302 | return false; |
| 303 | } else if (0 == m_paceerrsecs) { |
| 304 | return true; |
| 305 | } |
| 306 | |
| 307 | #if !defined(UNITTEST) |
| 308 | TSHRTime const timenow = TShrtime(); |
| 309 | #endif |
| 310 | |
| 311 | std::lock_guard<std::mutex> const guard(m_mutex); |
| 312 | |
| 313 | #if !defined(UNITTEST) |
| 314 | if (timenow < m_nextlogtime) { |
| 315 | return false; |
| 316 | } |
| 317 | |
| 318 | m_nextlogtime = timenow + TS_HRTIME_SECONDS(m_paceerrsecs); |
| 319 | #else |
| 320 | m_nextlogtime = 0; // needed by clang |
| 321 | #endif |
| 322 | |
| 323 | return true; |
| 324 | } |
| 325 | |
| 326 | bool |
| 327 | Config::matchesRegex(char const *const url, int const urllen) const |
no test coverage detected