gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-anastasis-gtk] branch master updated: prevent /config request dur


From: gnunet
Subject: [taler-anastasis-gtk] branch master updated: prevent /config request during action updating widget state
Date: Sun, 11 Apr 2021 12:38:52 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository anastasis-gtk.

The following commit(s) were added to refs/heads/master by this push:
     new fa49de4  prevent /config request during action updating widget state
fa49de4 is described below

commit fa49de4dd3a80f1820f062c3c08dec3f4d504e76
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun Apr 11 12:38:50 2021 +0200

    prevent /config request during action updating widget state
---
 src/anastasis/anastasis-gtk_action.c                     | 16 +++++++++++-----
 src/anastasis/anastasis-gtk_action.h                     |  5 +++++
 .../anastasis-gtk_handle-policy-version-changed.c        |  2 ++
 3 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/src/anastasis/anastasis-gtk_action.c 
b/src/anastasis/anastasis-gtk_action.c
index 4c09008..c588fc1 100644
--- a/src/anastasis/anastasis-gtk_action.c
+++ b/src/anastasis/anastasis-gtk_action.c
@@ -34,6 +34,13 @@
 #include <qrencode.h>
 #include <gdk-pixbuf/gdk-pixbuf.h>
 
+
+/**
+ * Are we currently processing an action?
+ */
+bool AG_in_action;
+
+
 #define DEBUG 0
 
 /**
@@ -2505,7 +2512,6 @@ AG_action_cb (void *cls,
               enum TALER_ErrorCode error_code,
               json_t *response)
 {
-  static bool in_action;
   struct DispatchItem actions[] = {
     { .state = "CONTINENT_SELECTING",
       .action = &action_continent_selecting },
@@ -2556,7 +2562,7 @@ AG_action_cb (void *cls,
     AG_error ("Error #%d: %s\n",
               (int) error_code,
               TALER_ErrorCode_get_hint (error_code));
-    if (in_action)
+    if (AG_in_action)
     {
       GNUNET_break (0);
       return;
@@ -2577,14 +2583,14 @@ AG_action_cb (void *cls,
                                         "recovery_state",
                                         json_string ("CHALLENGE_SELECTING")));
   }
-  in_action = true;
+  AG_in_action = true;
   if (GNUNET_OK ==
       AG_dispatch (actions))
   {
-    in_action = false;
+    AG_in_action = false;
     return;
   }
-  in_action = false;
+  AG_in_action = false;
   AG_error ("Unhandled state `%s/%s'",
             json_string_value (json_object_get (AG_redux_state,
                                                 "backup_state")),
diff --git a/src/anastasis/anastasis-gtk_action.h 
b/src/anastasis/anastasis-gtk_action.h
index 62c0778..8db3c6d 100644
--- a/src/anastasis/anastasis-gtk_action.h
+++ b/src/anastasis/anastasis-gtk_action.h
@@ -32,6 +32,11 @@
 #include <anastasis/anastasis_redux.h>
 
 
+/**
+ * Are we currently processing an action?
+ */
+extern bool AG_in_action;
+
 /**
  * Function called with the results of #ANASTASIS_redux_action.
  *
diff --git a/src/anastasis/anastasis-gtk_handle-policy-version-changed.c 
b/src/anastasis/anastasis-gtk_handle-policy-version-changed.c
index f9ee34f..dd22c28 100644
--- a/src/anastasis/anastasis-gtk_handle-policy-version-changed.c
+++ b/src/anastasis/anastasis-gtk_handle-policy-version-changed.c
@@ -88,6 +88,8 @@ update_policy (void)
   const char *provider_url;
   GtkWidget *toplevel;
 
+  if (AG_in_action)
+    return;
   toplevel = gtk_widget_get_toplevel (
     GTK_WIDGET (GCG_get_main_window_object (
                   "anastasis_gtk_main_window")));

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]