dnf-json: Avoid leaking memory on the Cpp side

To avoid dnf leaking memory, dnf-json as a service calls fork() on each
request. This allow memory to be freed automatically when the process
handling the request is destroyed.
This commit is contained in:
Thomas Lavocat 2021-11-30 10:50:59 +01:00 committed by Thomas Lavocat
parent f8281eee54
commit 0877ae3ac0

View file

@ -255,7 +255,7 @@ log.info("Starting the dnf-json server")
LISTEN_FDS = int(os.environ.get("LISTEN_FDS", 0))
class SystemDActivationSocketServer(socketserver.UnixStreamServer):
class SystemDActivationSocketServer(socketserver.ForkingMixIn, socketserver.UnixStreamServer):
def server_bind(self):
log.debug("service bind")
assert LISTEN_FDS == 1