diff options
author | Werner Koch <[email protected]> | 2019-06-21 08:47:45 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2019-06-21 09:42:59 +0000 |
commit | 91e2931caac9b914efa0a4524effaaa5948ebd00 (patch) | |
tree | 87f0209484396fcbb26d1c1f65fff620b79be7d5 /scd/command.c | |
parent | scd: Simplify inclusion of app-common.h. (diff) | |
download | gnupg-91e2931caac9b914efa0a4524effaaa5948ebd00.tar.gz gnupg-91e2931caac9b914efa0a4524effaaa5948ebd00.zip |
scd: Track the currently selected app.
* scd/scdaemon.h (struct server_control_s): Add 'current_apptype'.
* scd/command.c (scd_clear_current_app): New.
* scd/app.c (app_new_register): Set it.
(deallocate_card): Clear it.
--
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'scd/command.c')
-rw-r--r-- | scd/command.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/scd/command.c b/scd/command.c index 3c63ef5fd..c45737376 100644 --- a/scd/command.c +++ b/scd/command.c @@ -2069,6 +2069,21 @@ scd_command_handler (ctrl_t ctrl, int fd) } +/* Clear the current application info for CARD from all sessions. + * This is used while deallocating a card. */ +void +scd_clear_current_app (card_t card) +{ + struct server_local_s *sl; + + for (sl=session_list; sl; sl = sl->next_session) + { + if (sl->ctrl_backlink->card_ctx == card) + sl->ctrl_backlink->current_apptype = APPTYPE_NONE; + } +} + + /* Send a line with status information via assuan and escape all given buffers. The variable elements are pairs of (char *, size_t), terminated with a (NULL, 0). */ @@ -2181,7 +2196,7 @@ popup_prompt (void *opaque, int on) /* Helper to send the clients a status change notification. Note that - * this fucntion assumes that APP is already locked. */ + * this function assumes that APP is already locked. */ void send_client_notifications (card_t card, int removal) { |