waitMoveIsDone() used to poll GetStatus for at most ~4 s and only
understood MoveStatus. Cameras that report only the position (or report
MoveStatus only away from 0/0/0) always ran into the timeout.
- After create(), protocolPTZ_ONVIF detects what the camera reports:
PTZ GetServiceCapabilities (MoveStatus / StatusPosition attributes)
plus a real GetStatus probe. The result is logged
("PTZ status support: ...").
- waitMoveIsDone():
* MoveStatus cameras: poll every 200 ms until pan/tilt and zoom are
IDLE (IDLE right after the command is ignored for 1 s unless the
camera was seen MOVING or is already on target);
* position-only cameras: until the AbsoluteMove target is reached or
the position stops changing;
* cameras reporting neither: fixed 3 s wait.
Gives up after 10 s, falls back to the fixed wait after 3 failed
GetStatus calls.
- pOnvif::ptz_GetStatus: Position and MoveStatus are optional in the
schema; read every element NULL-safe, always read MoveStatus, report
hasPosition / hasZoomPosition / isMoving.
- pOnvif::_send_request: arm the reply flag before queuing the request
and ignore late replies of timed-out requests, so a poll can no longer
get the answer of the previous request.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
The report engine now keeps a separate SQLite database for every local
hour inside the day folder:
data/reports/YYYY/MM/DD/report_HH.db (REPORT_DB_NAME_FMT "report_%02d.db")
Pictures and videos stay in the day folder; the stat.db day records are
unchanged.
- sqliteDBC::openHourReport(): opens/creates report_HH.db of the given day
and hour (replaces openDayReport); switchReportToCurrentHour() (renamed
from switchReportToCurrentDay) switches when the local day or hour
changes. connect() opens the current hour's file at startup.
- mojoKernel::handleReportPeriodChange() (was handleDayChange): runs the
same close-then-switch sequence every local hour: an open session that
started in the previous hour is closed in the old file (waiting at most
REPORT_SWITCH_MAX_VIDEO_WAIT for a recording with events), then the
report switches to the new hour; the next event opens a new session.
Each hourly file therefore contains complete sessions.
- getLocalHour() helper in basicFunctionality.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
Timestamps are now formatted with strftime("%Y-%m-%d %H:%M:%S%z"), e.g.
"2026-11-26 12:14:55+0200", so log lines are unambiguous across time
zones and daylight-saving changes. Applies to all log modes that include
time (_LOG_TIME, _LOG_TIME_PTR, _LOG_LVL_TIME, _LOG_LVL_TIME_PTR); the rest
of the line format is unchanged. In GMT mode the offset is +0000.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
Continuous leaks:
- protocolParser: on package-pool overflow the oldest package was removed
but never freed while the newest (still pooled) one was freed. Every
packet a handler does not consume (e.g. other sensors on a shared bus)
leaked once the pool was full. Free the removed package, free pooled
packages in the destructor and getPackage(), use memmove for the
overlapping buffer shifts.
- SQLite_Connector::Query: loop only while sqlite3_step() returns
SQLITE_ROW. Looping until SQLITE_DONE spun forever allocating rows on
SQLITE_BUSY/ERROR. Set a busy timeout, close handles after a failed
open, fix escapeBinary() writing into uninitialised buffers.
- basicThread/basicDualThread: threads that ended by themselves were never
joined, leaking their stacks on every stream drop/restart. Always join
once (detach when called from the thread itself); check pthread_create
result correctly.
- curlRequest: free the header list; initialise m_pPostData and the
content type; curlRequestsManager deletes requests it cannot queue.
- kernelModuleModemManager: free the phonebook ID list on every reload.
- deviceNodeFactory: do not append the same pending node every cycle.
- streamHandler: free frames left in the encoding queue on destruction.
Heap corruption:
- kernelModuleFactory: module that failed to start was deleted twice.
- mojoRemoteClient: basicRing::push() returns an ID (may be 0), not a
bool; compare with -1. Fix packetExtractor and destructor leaks.
- utilizeBasicEvent: payloads are malloc'ed, release with free().
- videoAVLIBSource: avoid sws context double free, NULL check order.
- trim(): memmove for overlapping copy.
Smaller leaks: dropSession duplicate query, LRF upload data, report
backupper / fly hunter settings, Kafka consumer handle, BVMS uniq ID.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16