gnunet-svn
[Top][All Lists]
Advanced

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

[taler-challenger] branch master updated: -misc bugfixes


From: gnunet
Subject: [taler-challenger] branch master updated: -misc bugfixes
Date: Sun, 18 Feb 2024 11:13:03 +0100

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

grothoff pushed a commit to branch master
in repository challenger.

The following commit(s) were added to refs/heads/master by this push:
     new ac98fa5  -misc bugfixes
ac98fa5 is described below

commit ac98fa5e3b275ee010e72cd5446a9a03632867ed
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun Feb 18 11:12:58 2024 +0100

    -misc bugfixes
---
 src/challenger/challenger-httpd_authorize.c         | 21 +++++++++++++++++----
 src/challenger/challenger-httpd_challenge.c         | 21 +++++++++++++++++----
 .../challenger_do_validate_and_solve_pin.sql        |  2 +-
 3 files changed, 35 insertions(+), 9 deletions(-)

diff --git a/src/challenger/challenger-httpd_authorize.c 
b/src/challenger/challenger-httpd_authorize.c
index 20f4136..4e68a45 100644
--- a/src/challenger/challenger-httpd_authorize.c
+++ b/src/challenger/challenger-httpd_authorize.c
@@ -191,6 +191,9 @@ CH_handler_authorize (struct CH_HandlerContext *hc,
       enum GNUNET_GenericReturnValue ret;
       json_t *args;
       char *form;
+      struct MHD_Response *resp;
+      unsigned int http_status;
+      MHD_RESULT res;
 
       GNUNET_asprintf (&form,
                        "enter-%s-form",
@@ -206,13 +209,15 @@ CH_handler_authorize (struct CH_HandlerContext *hc,
         GNUNET_JSON_pack_uint64 ("changes_left",
                                  address_attempts_left)
         );
-      ret = TALER_TEMPLATING_reply (
+      http_status = MHD_HTTP_OK;
+      ret = TALER_TEMPLATING_build (
         hc->connection,
-        MHD_HTTP_OK,
+        &http_status,
         form,
         NULL,
         NULL,
-        args);
+        args,
+        &resp);
       GNUNET_free (form);
       json_decref (args);
       if (GNUNET_SYSERR == ret)
@@ -221,7 +226,15 @@ CH_handler_authorize (struct CH_HandlerContext *hc,
         return MHD_NO;
       }
       GNUNET_break (GNUNET_OK == ret);
-      return MHD_YES;
+      GNUNET_break (MHD_YES ==
+                    MHD_add_response_header (resp,
+                                             MHD_HTTP_HEADER_CACHE_CONTROL,
+                                             "no-store,no-cache"));
+      res = MHD_queue_response (hc->connection,
+                                http_status,
+                                resp);
+      MHD_destroy_response (resp);
+      return res;
     }
   }
 }
diff --git a/src/challenger/challenger-httpd_challenge.c 
b/src/challenger/challenger-httpd_challenge.c
index d9ae59f..e346b62 100644
--- a/src/challenger/challenger-httpd_challenge.c
+++ b/src/challenger/challenger-httpd_challenge.c
@@ -607,6 +607,9 @@ CH_handler_challenge (struct CH_HandlerContext *hc,
   {
     json_t *args;
     enum GNUNET_GenericReturnValue ret;
+    struct MHD_Response *resp;
+    unsigned int http_status;
+    MHD_RESULT res;
 
     args = GNUNET_JSON_PACK (
       GNUNET_JSON_pack_uint64 ("attempts_left",
@@ -623,12 +626,14 @@ CH_handler_challenge (struct CH_HandlerContext *hc,
                                    bc->last_tx_time,
                                    CH_validation_duration)))
       );
-    ret = TALER_TEMPLATING_reply (hc->connection,
-                                  MHD_HTTP_OK,
+    http_status = MHD_HTTP_OK;
+    ret = TALER_TEMPLATING_build (hc->connection,
+                                  &http_status,
                                   "enter-tan-form",
                                   NULL,
                                   NULL,
-                                  args);
+                                  args,
+                                  &resp);
     json_decref (args);
     if (GNUNET_SYSERR == ret)
     {
@@ -636,6 +641,14 @@ CH_handler_challenge (struct CH_HandlerContext *hc,
       return MHD_NO;
     }
     GNUNET_break (GNUNET_OK == ret);
-    return MHD_YES;
+    GNUNET_break (MHD_YES ==
+                  MHD_add_response_header (resp,
+                                           MHD_HTTP_HEADER_CACHE_CONTROL,
+                                           "no-store,no-cache"));
+    res = MHD_queue_response (hc->connection,
+                              http_status,
+                              resp);
+    MHD_destroy_response (resp);
+    return res;
   }
 }
diff --git a/src/challengerdb/challenger_do_validate_and_solve_pin.sql 
b/src/challengerdb/challenger_do_validate_and_solve_pin.sql
index 0eaf251..51dbe36 100644
--- a/src/challengerdb/challenger_do_validate_and_solve_pin.sql
+++ b/src/challengerdb/challenger_do_validate_and_solve_pin.sql
@@ -79,7 +79,7 @@ ELSE
 END IF;
 
 UPDATE validations
- SET auth_attempts_left=my_status.auth_attempts_left
+ SET auth_attempts_left=out_auth_attempts_left
  WHERE nonce=$1;
 
 RETURN;

-- 
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]