gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] branch master updated: remove silly code duplication


From: gnunet
Subject: [taler-merchant] branch master updated: remove silly code duplication
Date: Thu, 04 Jan 2024 01:06:28 +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 a046a9c1 remove silly code duplication
a046a9c1 is described below

commit a046a9c17ccd5861fe2e44de0b77e9bf1daaacad
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Thu Jan 4 01:06:25 2024 +0100

    remove silly code duplication
---
 .../taler-merchant-httpd_private-get-orders-ID.c   | 44 +++++++---------------
 src/backend/taler-merchant-webhook.c               |  4 +-
 2 files changed, 15 insertions(+), 33 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_private-get-orders-ID.c 
b/src/backend/taler-merchant-httpd_private-get-orders-ID.c
index a19c64a4..4f7959bd 100644
--- a/src/backend/taler-merchant-httpd_private-get-orders-ID.c
+++ b/src/backend/taler-merchant-httpd_private-get-orders-ID.c
@@ -885,7 +885,6 @@ static void
 phase_check_paid (struct GetOrderRequestContext *gorc)
 {
   struct TMH_HandlerContext *hc = gorc->hc;
-  enum GNUNET_DB_QueryStatus qs;
 
   if (gorc->order_only)
   {
@@ -1048,22 +1047,21 @@ phase_unpaid_finish (struct GetOrderRequestContext 
*gorc)
   }
   /* User never paid for this order, suspend waiting
      on payment or return details. */
-
+  if (GNUNET_TIME_absolute_is_future (gorc->sc.long_poll_timeout))
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                "Suspending GET /private/orders/%s\n",
+                hc->infix);
+    GNUNET_CONTAINER_DLL_insert (gorc_head,
+                                 gorc_tail,
+                                 gorc);
+    gorc->phase = GOP_SUSPENDED_ON_UNPAID;
+    gorc->suspended = GNUNET_YES;
+    MHD_suspend_connection (gorc->sc.con);
+    return;
+  }
   if (! gorc->order_only)
   {
-    if (GNUNET_TIME_absolute_is_future (gorc->sc.long_poll_timeout))
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                  "Suspending GET /private/orders/%s\n",
-                  hc->infix);
-      GNUNET_CONTAINER_DLL_insert (gorc_head,
-                                   gorc_tail,
-                                   gorc);
-      gorc->phase = GOP_SUSPENDED_ON_UNPAID;
-      gorc->suspended = GNUNET_YES;
-      MHD_suspend_connection (gorc->sc.con);
-      return;
-    }
     GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                 "Order %s claimed but not paid yet\n",
                 hc->infix);
@@ -1077,22 +1075,6 @@ phase_unpaid_finish (struct GetOrderRequestContext *gorc)
                                           "claimed")));
     return;
   }
-
-  /* FIXME: too similar to logic above! */
-  if (GNUNET_TIME_absolute_is_future (gorc->sc.long_poll_timeout))
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                "Suspending GET /private/orders/%s\n",
-                hc->infix);
-    GNUNET_assert (GNUNET_NO == gorc->suspended);
-    GNUNET_CONTAINER_DLL_insert (gorc_head,
-                                 gorc_tail,
-                                 gorc);
-    gorc->suspended = GNUNET_YES;
-    gorc->phase = GOP_SUSPENDED_ON_UNPAID;
-    MHD_suspend_connection (gorc->sc.con);
-    return;
-  }
   taler_pay_uri = TMH_make_taler_pay_uri (gorc->sc.con,
                                           hc->infix,
                                           gorc->session_id,
diff --git a/src/backend/taler-merchant-webhook.c 
b/src/backend/taler-merchant-webhook.c
index 721153fa..99ab76d5 100644
--- a/src/backend/taler-merchant-webhook.c
+++ b/src/backend/taler-merchant-webhook.c
@@ -45,7 +45,7 @@ static struct WorkResponse *w_tail;
 static struct GNUNET_DB_EventHandler *eh;
 
 /**
- * The exchange's configuration.
+ * The merchant's configuration.
  */
 static const struct GNUNET_CONFIGURATION_Handle *cfg;
 
@@ -585,4 +585,4 @@ main (int argc,
 }
 
 
-/* end of taler-exchange-transfer.c */
+/* end of taler-merchant-webhook.c */

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