If the connection requesting the subscription already had
an outstanding subscription, remove it before processing.
This prevents immediate status updates from being pushed
to the requesting connection.
Don't add connections to the dictionary of subscribed
connections if the request is an empty object, as this
is a request to unsubscribe from all objects.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
The configfile "config" and "settings" attributes never change, and
therefore do not need to be stored in the subscription cache. They
can be significantly large, so this change can free up some memory
on low resource systems.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
If Klipper is using systemd socket activation to generate its
unix socket the PID reported by PEERCRED will be 1, that of
systemd itself. Klipper now reports its process id in the
"info" endpoint, use that as a fallback to retreive service info.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>