gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] branch master updated: addressing some of the @file war


From: gnunet
Subject: [taler-merchant] branch master updated: addressing some of the @file warnings
Date: Fri, 09 Oct 2020 18:00:51 +0200

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

ms pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new 95c2f2c  addressing some of the @file warnings
95c2f2c is described below

commit 95c2f2ce13dbdfa43a1e8fe01619a637ab269107
Author: MS <ms@taler.net>
AuthorDate: Fri Oct 9 18:00:33 2020 +0200

    addressing some of the @file warnings
---
 src/backend/taler-merchant-httpd.c                 |   2 +-
 src/backend/taler-merchant-httpd.h                 |   2 +-
 src/backend/taler-merchant-httpd_OBSOLETE.c        | 195 ---------------------
 ...ler-merchant-httpd_private-patch-instances-ID.c |   2 +-
 ...aler-merchant-httpd_private-patch-products-ID.c |   2 +-
 src/backend/taler-merchant-httpd_qr.c              |   2 +-
 src/backend/taler-merchant-httpd_qr.h              |   2 +-
 src/backend/taler-merchant-httpd_statics.c         |   2 +-
 src/backend/taler-merchant-httpd_statics.h         |   2 +-
 src/backend/taler-merchant-httpd_templating.c      |   2 +-
 src/backend/taler-merchant-httpd_templating.h      |   2 +-
 src/testing/testing_api_trait_string.c             |   2 +-
 12 files changed, 11 insertions(+), 206 deletions(-)

diff --git a/src/backend/taler-merchant-httpd.c 
b/src/backend/taler-merchant-httpd.c
index bf8de66..91c3c69 100644
--- a/src/backend/taler-merchant-httpd.c
+++ b/src/backend/taler-merchant-httpd.c
@@ -14,7 +14,7 @@
   TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
 */
 /**
- * @file merchant/backend/taler-merchant-httpd.c
+ * @file taler-merchant-httpd.c
  * @brief HTTP serving layer intended to perform crypto-work and
  * communication with the exchange
  * @author Marcello Stanisci
diff --git a/src/backend/taler-merchant-httpd.h 
b/src/backend/taler-merchant-httpd.h
index c631729..2e33b85 100644
--- a/src/backend/taler-merchant-httpd.h
+++ b/src/backend/taler-merchant-httpd.h
@@ -14,7 +14,7 @@
   TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
 */
 /**
- * @file merchant/backend/taler-merchant-httpd.h
+ * @file taler-merchant-httpd.h
  * @brief HTTP serving layer mainly intended to communicate with the frontend
  * @author Marcello Stanisci
  */
diff --git a/src/backend/taler-merchant-httpd_OBSOLETE.c 
b/src/backend/taler-merchant-httpd_OBSOLETE.c
deleted file mode 100644
index 62ebf45..0000000
--- a/src/backend/taler-merchant-httpd_OBSOLETE.c
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
-  This file is part of TALER
-  (C) 2014-2020 Taler Systems SA
-
-  TALER is free software; you can redistribute it and/or modify it under the
-  terms of the GNU Affero General Public License as published by the Free 
Software
-  Foundation; either version 3, or (at your option) any later version.
-
-  TALER is distributed in the hope that it will be useful, but WITHOUT ANY
-  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-  A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License along with
-  TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
-*/
-/**
- * @file backend/taler-merchant-httpd_refund.c
- * @brief HTTP serving layer mainly intended to communicate with the frontend
- * @author Marcello Stanisci
- */
-#include "platform.h"
-#include <jansson.h>
-#include <taler/taler_signatures.h>
-#include <taler/taler_json_lib.h>
-#include "taler-merchant-httpd.h"
-#include "taler-merchant-httpd_refund.h"
-
-/**
- * How often do we retry the non-trivial refund INSERT database
- * transaction?
- */
-#define MAX_RETRIES 5
-
-
-/**
- * Closure for #process_refunds_cb.
- */
-struct ProcessRefundData
-{
-  /**
-   * The array containing all the refund permissions.
-   */
-  json_t *response;
-
-  /**
-   * Hashed version of contract terms; needed by the callback
-   * to pack the response.
-   */
-  const struct GNUNET_HashCode *h_contract_terms;
-
-  /**
-   * Both public and private key are needed by the callback
-   */
-  const struct MerchantInstance *merchant;
-
-  /**
-   * Return code: #TALER_EC_NONE if successful.
-   */
-  enum TALER_ErrorCode ec;
-};
-
-
-/**
- * Function called with information about a refund.
- * It is responsible for packing up the data to return.
- *
- * @param cls closure
- * @param coin_pub public coin from which the refund comes from
- * @param exchange_url URL of the exchange that issued @a coin_pub
- * @param rtransaction_id identificator of the refund
- * @param reason human-readable explanation of the refund
- * @param refund_amount refund amount which is being taken from @a coin_pub
- * @param refund_fee cost of this refund operation
- */
-static void
-process_refunds_cb (void *cls,
-                    const struct TALER_CoinSpendPublicKeyP *coin_pub,
-                    const char *exchange_url,
-                    uint64_t rtransaction_id,
-                    const char *reason,
-                    const struct TALER_Amount *refund_amount,
-                    const struct TALER_Amount *refund_fee)
-{
-  struct ProcessRefundData *prd = cls;
-  struct GNUNET_CRYPTO_EddsaSignature sig;
-  json_t *element;
-
-  (void) exchange_url;
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Found refund of %s for coin %s with reason `%s' in database\n",
-              TALER_B2S (coin_pub),
-              TALER_amount2s (refund_amount),
-              reason);
-  {
-    struct TALER_RefundRequestPS rr = {
-      .purpose.purpose = htonl (TALER_SIGNATURE_MERCHANT_REFUND),
-      .purpose.size = htonl (sizeof (rr)),
-      .h_contract_terms = *prd->h_contract_terms,
-      .coin_pub = *coin_pub,
-      .merchant = prd->merchant->pubkey,
-      .rtransaction_id = GNUNET_htonll (rtransaction_id)
-    };
-
-    TALER_amount_hton (&rr.refund_amount,
-                       refund_amount);
-    TALER_amount_hton (&rr.refund_fee,
-                       refund_fee);
-    GNUNET_CRYPTO_eddsa_sign (&prd->merchant->privkey.eddsa_priv,
-                              &rr,
-                              &sig);
-  }
-
-  element = json_pack ("{s:o, s:o, s:o, s:I, s:o}",
-                       "refund_amount", TALER_JSON_from_amount (refund_amount),
-                       "refund_fee", TALER_JSON_from_amount (refund_fee),
-                       "coin_pub", GNUNET_JSON_from_data_auto (coin_pub),
-                       "rtransaction_id", (json_int_t) rtransaction_id,
-                       "merchant_sig", GNUNET_JSON_from_data_auto (&sig));
-  if (NULL == element)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Could not pack refund response element\n");
-    prd->ec = TALER_EC_PARSER_OUT_OF_MEMORY;
-    return;
-  }
-  if (-1 == json_array_append_new (prd->response,
-                                   element))
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Could not append a response's element\n");
-    prd->ec = TALER_EC_PARSER_OUT_OF_MEMORY;
-    return;
-  }
-}
-
-
-/**
- * Get the JSON representation of a refund.
- *
- * @param merchant_pub the merchant's public key
- * @param mi merchant instance
- * @param ret_ec where to store error code
- * @param ret_errmsg where to store error message
- * @return NULL on error, JSON array with refunds on success
- */
-json_t *
-TM_get_refund_json (const struct MerchantInstance *mi,
-                    const struct GNUNET_HashCode *h_contract_terms,
-                    enum TALER_ErrorCode *ret_ec,
-                    const char **ret_errmsg)
-{
-  enum GNUNET_DB_QueryStatus qs;
-  struct ProcessRefundData prd;
-
-  prd.response = json_array ();
-  if (NULL == prd.response)
-  {
-    GNUNET_break (0);
-    return NULL;
-  }
-  prd.h_contract_terms = h_contract_terms;
-  prd.merchant = mi;
-  prd.ec = TALER_EC_NONE;
-  db->preflight (db->cls);
-  for (unsigned int i = 0; i<MAX_RETRIES; i++)
-  {
-    qs = db->get_refunds_from_contract_terms_hash (db->cls,
-                                                   &mi->pubkey,
-                                                   h_contract_terms,
-                                                   &process_refunds_cb,
-                                                   &prd);
-    if (GNUNET_DB_STATUS_SOFT_ERROR != qs)
-      break;
-  }
-  if (0 > qs)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Database hard error on refunds_from_contract_terms_hash 
lookup: %s\n",
-                GNUNET_h2s (h_contract_terms));
-    json_decref (prd.response);
-    *ret_ec = TALER_EC_REFUND_LOOKUP_DB_ERROR;
-    *ret_errmsg = "Failed to lookup refunds for contract";
-  }
-  if (TALER_EC_NONE != prd.ec)
-  {
-    json_decref (prd.response);
-    /* NOTE: error already logged by the callback */
-    *ret_ec = prd.ec;
-    *ret_errmsg = "Could not generate a response";
-  }
-  return prd.response;
-}
-
-
-/* end of taler-merchant-httpd_refund.c */
diff --git a/src/backend/taler-merchant-httpd_private-patch-instances-ID.c 
b/src/backend/taler-merchant-httpd_private-patch-instances-ID.c
index 94c02ea..94ecca4 100644
--- a/src/backend/taler-merchant-httpd_private-patch-instances-ID.c
+++ b/src/backend/taler-merchant-httpd_private-patch-instances-ID.c
@@ -18,7 +18,7 @@
 */
 
 /**
- * @file backend/taler-merchant-httpd_private-patch-instances.c
+ * @file taler-merchant-httpd_private-patch-instances-ID.c
  * @brief implementing PATCH /instances/$ID request handling
  * @author Christian Grothoff
  */
diff --git a/src/backend/taler-merchant-httpd_private-patch-products-ID.c 
b/src/backend/taler-merchant-httpd_private-patch-products-ID.c
index 0d722b5..5fd3a1e 100644
--- a/src/backend/taler-merchant-httpd_private-patch-products-ID.c
+++ b/src/backend/taler-merchant-httpd_private-patch-products-ID.c
@@ -18,7 +18,7 @@
 */
 
 /**
- * @file backend/taler-merchant-httpd_private-patch-products.c
+ * @file taler-merchant-httpd_private-patch-products-ID.c
  * @brief implementing PATCH /products/$ID request handling
  * @author Christian Grothoff
  */
diff --git a/src/backend/taler-merchant-httpd_qr.c 
b/src/backend/taler-merchant-httpd_qr.c
index 1774f75..4539bee 100644
--- a/src/backend/taler-merchant-httpd_qr.c
+++ b/src/backend/taler-merchant-httpd_qr.c
@@ -14,7 +14,7 @@
   TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
 */
 /**
- * @file merchant/backend/taler-merchant-httpd_qr.c
+ * @file taler-merchant-httpd_qr.c
  * @brief logic to create QR codes in HTML
  * @author Christian Grothoff
  */
diff --git a/src/backend/taler-merchant-httpd_qr.h 
b/src/backend/taler-merchant-httpd_qr.h
index ffcb004..2a91d7c 100644
--- a/src/backend/taler-merchant-httpd_qr.h
+++ b/src/backend/taler-merchant-httpd_qr.h
@@ -14,7 +14,7 @@
   TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
 */
 /**
- * @file merchant/backend/taler-merchant-httpd_qr.h
+ * @file taler-merchant-httpd_qr.h
  * @brief logic to create QR codes in HTML
  * @author Christian Grothoff
  */
diff --git a/src/backend/taler-merchant-httpd_statics.c 
b/src/backend/taler-merchant-httpd_statics.c
index e8be2cb..3d852ae 100644
--- a/src/backend/taler-merchant-httpd_statics.c
+++ b/src/backend/taler-merchant-httpd_statics.c
@@ -14,7 +14,7 @@
   TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
 */
 /**
- * @file merchant/backend/taler-merchant-httpd_statics.c
+ * @file taler-merchant-httpd_statics.c
  * @brief logic to load and complete HTML templates
  * @author Christian Grothoff
  */
diff --git a/src/backend/taler-merchant-httpd_statics.h 
b/src/backend/taler-merchant-httpd_statics.h
index dac06a0..271d28e 100644
--- a/src/backend/taler-merchant-httpd_statics.h
+++ b/src/backend/taler-merchant-httpd_statics.h
@@ -14,7 +14,7 @@
   TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
 */
 /**
- * @file merchant/backend/taler-merchant-httpd_statics.h
+ * @file taler-merchant-httpd_statics.h
  * @brief logic to preload and serve static files
  * @author Christian Grothoff
  */
diff --git a/src/backend/taler-merchant-httpd_templating.c 
b/src/backend/taler-merchant-httpd_templating.c
index 3d189a7..b604f6b 100644
--- a/src/backend/taler-merchant-httpd_templating.c
+++ b/src/backend/taler-merchant-httpd_templating.c
@@ -14,7 +14,7 @@
   TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
 */
 /**
- * @file merchant/backend/taler-merchant-httpd_templating.c
+ * @file taler-merchant-httpd_templating.c
  * @brief logic to load and complete HTML templates
  * @author Christian Grothoff
  */
diff --git a/src/backend/taler-merchant-httpd_templating.h 
b/src/backend/taler-merchant-httpd_templating.h
index 6f22e79..1fb4781 100644
--- a/src/backend/taler-merchant-httpd_templating.h
+++ b/src/backend/taler-merchant-httpd_templating.h
@@ -14,7 +14,7 @@
   TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
 */
 /**
- * @file merchant/backend/taler-merchant-httpd_templating.h
+ * @file taler-merchant-httpd_templating.h
  * @brief logic to load and complete HTML templates
  * @author Christian Grothoff
  */
diff --git a/src/testing/testing_api_trait_string.c 
b/src/testing/testing_api_trait_string.c
index 30db2f6..cff0f63 100644
--- a/src/testing/testing_api_trait_string.c
+++ b/src/testing/testing_api_trait_string.c
@@ -62,7 +62,7 @@ TALER_TESTING_get_trait_proposal_reference
  *
  * @param index which reference to offer if there are
  *        multiple on offer.
- * @param proposal_reference pointer to the reference to offer.
+ * @param proposal_reference[out] pointer to the reference to offer.
  *
  * @return the trait
  */

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