mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-09-21 10:05:38 -04:00
An undecodable reply means the camera and this module no longer agree about the session, but nothing put that right. Dahua_RPC re-logs-in only when it gets a parseable error back, so rpc_call returning undef left the session poisoned: in the logs a CoaxialControlIO.control failure is followed by every later keepAlive and logout on that session failing the same way, until something else forces a login. A light switched on by an alarm stays on for that whole period. Split the single attempt out as rpc_once, recording why it failed, and have rpc_call re-login and retry once when the failure was a decode failure on a masked Request. The guards matter more than the retry: - bootstrap channels never recover, since login() issues them - login() calls logout(), a Request on the dead session, so a re-entrancy guard stops its own decode failure starting another recovery - one retry only, and a 5 second backoff, so a camera that always answers unreadably is not met with a login per command refs #4423 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UvTCzCbvGt8xKQRNCSA7o8