From d8968bff5aebd35f454d7c7e91d1975fc8883027 Mon Sep 17 00:00:00 2001 From: Ben Kibbey Date: Sun, 18 Nov 2007 19:49:21 -0500 Subject: [PATCH] Added RESET command handling. It'll free all the resources of the document and act like a new connection without any open file. --- src/commands.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/commands.c b/src/commands.c index 9cfa4614..a443dce0 100644 --- a/src/commands.c +++ b/src/commands.c @@ -2299,6 +2299,13 @@ void cleanup_assuan(assuan_context_t ctx) cleanup_client(cl); } +static void reset_notify(assuan_context_t ctx) +{ + struct client_s *cl = assuan_get_pointer(ctx); + + cleanup_client(cl); +} + gpg_error_t register_commands(assuan_context_t ctx) { static struct { @@ -2331,7 +2338,11 @@ gpg_error_t register_commands(assuan_context_t ctx) return rc; } - return assuan_register_bye_notify(ctx, cleanup_assuan); + rc = assuan_register_bye_notify(ctx, cleanup_assuan); + if (rc) + return rc; + + return assuan_register_reset_notify(ctx, reset_notify); } gpg_error_t try_xml_decrypt(assuan_context_t ctx, gint fd, struct stat st, -- 2.11.4.GIT