feat(video): enhance video frame handling with atomic reference counting and memory management

Signed-off-by: luckfox-eng29 <eng29@luckfox.com>
This commit is contained in:
luckfox-eng29
2026-05-15 18:46:51 +08:00
parent 40f5af2120
commit 2a2890e7b3
5 changed files with 95 additions and 29 deletions

View File

@@ -163,12 +163,11 @@ func handleVpnCtrlClient(conn net.Conn) {
scopedLogger.Warn().Err(err).Msg("error reading from vpn sock")
break
}
readMsg := string(readBuf[:n])
vpnResp := CtrlResponse{}
err = json.Unmarshal([]byte(readMsg), &vpnResp)
err = json.Unmarshal(readBuf[:n], &vpnResp)
if err != nil {
scopedLogger.Warn().Err(err).Str("data", readMsg).Msg("error parsing vpn sock msg")
scopedLogger.Warn().Err(err).Str("data", string(readBuf[:n])).Msg("error parsing vpn sock msg")
continue
}
scopedLogger.Trace().Interface("data", vpnResp).Msg("vpn sock msg")