Skip to content

Fix: After the cursor leaves Thumbs, ZMS must always be stopped, even in case of network problems.#4430

Draft
IgorA100 wants to merge 12 commits intoZoneMinder:masterfrom
IgorA100:patch-527046
Draft

Fix: After the cursor leaves Thumbs, ZMS must always be stopped, even in case of network problems.#4430
IgorA100 wants to merge 12 commits intoZoneMinder:masterfrom
IgorA100:patch-527046

Conversation

@IgorA100
Copy link
Copy Markdown
Contributor

For all Thumbs we will assign the attribute "data-monitor-url" so that we can send ZMS the CMD_QUIT command without using MonitorStream.
We should not rely only on SIGPIPE, we must terminate ZMS correctly in any case.

Closed #4418

Next we will use this attribute to stop the ZMS process after the cursor leaves the image by sending the CMD_QUIT command.
… can send ZMS the CMD_QUIT command without using MonitorStream. (monitor.php)
… can send ZMS the CMD_QUIT command without using MonitorStream. (console.php)
Here adding the attribute is not necessary, because when hovering the cursor ZMS does not start at the moment. I added it for consistency. It will not make things worse.
… can send ZMS the CMD_QUIT command without using MonitorStream. (watch.php)
@connortechnology
Copy link
Copy Markdown
Member

That isn't going to do it.

We need a keepalive. The zms cgi needs a keepalive parameter, so that if it doesn't get a status update request after so many seconds, it dies. We can't depend on CMD_QUIT.

@IgorA100
Copy link
Copy Markdown
Contributor Author

IgorA100 commented Aug 29, 2025

That isn't going to do it.

Why? It works fine for me! I'm debugging JS now.

The zms cgi needs a keepalive parameter

Yeah, I agree. That would be a great option. But I don't know how to do it :(
If you did this in C++, I would arrange for a command to be sent to maintain the connection.

We can't depend on CMD_QUIT.

Yeah, but it's better than relying on SIGPIPE alone

@IgorA100
Copy link
Copy Markdown
Contributor Author

This PR works!
But of course it is better to use keepalive for ZMS

@IgorA100
Copy link
Copy Markdown
Contributor Author

@connortechnology
In this PR we add a attribute to the IMG so that we can send a command to the server where the monitor is served. This attribute will also be needed if you implement keepalive for ZMS. If keepalive is implemented for ZMS, then a very small change will need to be made to skin.js.
This PR works, but I certainly like the implementation of keepalive for ZMS more, but I can't do it in C++

@IgorA100 IgorA100 marked this pull request as ready for review August 31, 2025 19:04
@IgorA100
Copy link
Copy Markdown
Contributor Author

IgorA100 commented Mar 5, 2026

@connortechnology
Should I continue working on this PR and resolve the conflicts or should I close this PR?

@connortechnology
Copy link
Copy Markdown
Member

Is it still needed? There have been a few changes that may have made it obsolete.
I like the placeholder image stuff and having a connkey generator.
I don't like the putting urltoindex into each thumbnail... seems like not the best way to do it. Maybe a better way to go would be mid, and then we can just look up in our js data structures the monitor object and get the url from there.

@IgorA100
Copy link
Copy Markdown
Contributor Author

IgorA100 commented Mar 5, 2026

Is it still needed?

I'm not sure, but it's likely necessary. I have one server that hasn't been updated in a long time and it uses this PR. Some other servers don't use a domain name, just an IP address, and there are no problems. I'll need to retest this PR in more detail with the current code.

I don't like the putting urltoindex into each thumbnail...

This was the fastest solution with minimal code changes. I think it's possible to skip urltoindex and get the data using JS.

@IgorA100 IgorA100 marked this pull request as draft March 21, 2026 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ZMS process is not killed on Console page after cursor leaves monitor image

2 participants