dirmngr: Add a background task framework.
authorWerner Koch <wk@gnupg.org>
Tue, 14 Nov 2017 12:42:18 +0000 (13:42 +0100)
committerWerner Koch <wk@gnupg.org>
Tue, 14 Nov 2017 12:42:18 +0000 (13:42 +0100)
commit96a4fbecd1acf946dcde20bef4752c539dae196b
tree2aad45b34a7d144b918945a90645be98325b4f0b
parent26f08343fbccdbaa177c3507a3c5e24a5cf94a2d
dirmngr: Add a background task framework.

* dirmngr/workqueue.c: New.
* dirmngr/Makefile.am (dirmngr_SOURCES): Add new file.
* dirmngr/server.c (server_local_s): New field session_id.
(cmd_wkd_get): Add a task.
(task_check_wkd_support): New stub function.
(cmd_getinfo): New sub-commands "session_id" and "workqueue".
(start_command_handler): Add arg session_id and store it in
SERVER_LOCAL.
(dirmngr_status_helpf): New.
* dirmngr/dirmngr.h (wqtask_t): New type.
* dirmngr/dirmngr.c (main): Pass 0 as session_id to
start_command_handler.
(start_connection_thread): Introduce a session_id and pass it to
start_command_handler.  Run post session tasks.
(housekeeping_thread): Run global workqueue tasks.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
dirmngr/Makefile.am
dirmngr/dirmngr.c
dirmngr/dirmngr.h
dirmngr/server.c
dirmngr/workqueue.c [new file with mode: 0644]