gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] branch master updated: -fix spa redirect for instances


From: gnunet
Subject: [taler-merchant] branch master updated: -fix spa redirect for instances
Date: Tue, 21 Nov 2023 20:53:57 +0100

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

grothoff pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new f1cc5bea -fix spa redirect for instances
f1cc5bea is described below

commit f1cc5beaf957ba7ae575ee4055700c699112c9e6
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Tue Nov 21 20:53:46 2023 +0100

    -fix spa redirect for instances
---
 src/backend/taler-merchant-httpd.c                     | 9 +++++++++
 src/backend/taler-merchant-httpd_private-post-orders.c | 7 +++++++
 2 files changed, 16 insertions(+)

diff --git a/src/backend/taler-merchant-httpd.c 
b/src/backend/taler-merchant-httpd.c
index 9137c39b..64fa7005 100644
--- a/src/backend/taler-merchant-httpd.c
+++ b/src/backend/taler-merchant-httpd.c
@@ -602,6 +602,7 @@ spa_redirect (const struct TMH_RequestHandler *rh,
 {
   const char *text = "Redirecting to /webui/";
   struct MHD_Response *response;
+  char *dst;
 
   response = MHD_create_response_from_buffer (strlen (text),
                                               (void *) text,
@@ -616,6 +617,12 @@ spa_redirect (const struct TMH_RequestHandler *rh,
                 MHD_add_response_header (response,
                                          MHD_HTTP_HEADER_CONTENT_TYPE,
                                          "text/plain"));
+  if (NULL == hc->instance)
+    dst = GNUNET_strdup ("/webui/");
+  else
+    GNUNET_asprintf (&dst,
+                     "/instances/%s/webui/",
+                     hc->instance->settings.id);
   if (MHD_NO ==
       MHD_add_response_header (response,
                                MHD_HTTP_HEADER_LOCATION,
@@ -623,8 +630,10 @@ spa_redirect (const struct TMH_RequestHandler *rh,
   {
     GNUNET_break (0);
     MHD_destroy_response (response);
+    GNUNET_free (dst);
     return MHD_NO;
   }
+  GNUNET_free (dst);
 
   {
     MHD_RESULT ret;
diff --git a/src/backend/taler-merchant-httpd_private-post-orders.c 
b/src/backend/taler-merchant-httpd_private-post-orders.c
index 5f06eee2..4d60fa2d 100644
--- a/src/backend/taler-merchant-httpd_private-post-orders.c
+++ b/src/backend/taler-merchant-httpd_private-post-orders.c
@@ -892,6 +892,13 @@ update_stefan (struct OrderContext *oc,
 
     TALER_EXCHANGE_keys_stefan_round (keys,
                                       &net);
+    if (-1 == TALER_amount_cmp (&oc->brutto,
+                                &net))
+    {
+      /* brutto < netto! */
+      /* => after rounding, there is no real difference */
+      net = oc->brutto;
+    }
     GNUNET_assert (0 <=
                    TALER_amount_subtract (&fee,
                                           &oc->brutto,

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