[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-donau] branch master updated: minor changes, rm metrics
From: |
gnunet |
Subject: |
[taler-donau] branch master updated: minor changes, rm metrics |
Date: |
Mon, 13 May 2024 14:57:46 +0200 |
This is an automated email from the git hooks/post-receive script.
johannes-casaburi pushed a commit to branch master
in repository donau.
The following commit(s) were added to refs/heads/master by this push:
new e541516 minor changes, rm metrics
e541516 is described below
commit e541516d3a6528ecea5861c3a8ea6d37f07f36ae
Author: Casaburi Johannes <johannes.casaburi@students.bfh.ch>
AuthorDate: Mon May 13 14:56:59 2024 +0200
minor changes, rm metrics
---
contrib/gana | 2 +-
src/donau/Makefile.am | 1 -
src/donau/donau-httpd.c | 29 ------
src/donau/donau-httpd_batch-issue.c | 18 ++--
src/donau/donau-httpd_batch-submit.c | 5 +-
src/donau/donau-httpd_batch-submit.h | 2 +-
src/donau/donau-httpd_charity_delete.c | 8 +-
src/donau/donau-httpd_charity_insert.c | 2 -
src/donau/donau-httpd_csr.c | 65 ++++++-------
src/donau/donau-httpd_csr.h | 7 +-
src/donau/donau-httpd_db.c | 8 +-
src/donau/donau-httpd_db.h | 24 +----
src/donau/donau-httpd_history_get.c | 3 +-
src/donau/donau-httpd_keys.c | 4 +-
src/donau/donau-httpd_keys.h | 13 +--
src/donau/donau-httpd_metrics.c | 165 ---------------------------------
src/donau/donau-httpd_metrics.h | 136 ---------------------------
src/donau/donau-httpd_mhd.c | 2 +-
src/donau/donau-httpd_mhd.h | 2 +-
src/donau/donau-httpd_terms.c | 3 +-
src/donau/donau-httpd_terms.h | 3 +-
21 files changed, 61 insertions(+), 441 deletions(-)
diff --git a/contrib/gana b/contrib/gana
index 63ab2f3..e710326 160000
--- a/contrib/gana
+++ b/contrib/gana
@@ -1 +1 @@
-Subproject commit 63ab2f3c99c86334cc433450d7b99375ebf9d6b1
+Subproject commit e7103267008996a81bbcec6cc2997196d841a364
diff --git a/src/donau/Makefile.am b/src/donau/Makefile.am
index bad96b4..84b788f 100644
--- a/src/donau/Makefile.am
+++ b/src/donau/Makefile.am
@@ -39,7 +39,6 @@ donau_httpd_LDADD = \
donau_httpd_SOURCES = \
donau-httpd.c donau-httpd.h \
- donau-httpd_metrics.c donau-httpd_metrics.h \
donau-httpd_db.c donau-httpd_db.h \
donau-httpd_keys.c donau-httpd_keys.h \
donau-httpd_config.c donau-httpd_config.h \
diff --git a/src/donau/donau-httpd.c b/src/donau/donau-httpd.c
index 1a64177..33adb31 100644
--- a/src/donau/donau-httpd.c
+++ b/src/donau/donau-httpd.c
@@ -79,11 +79,6 @@ const struct GNUNET_CONFIGURATION_Handle *DH_cfg;
*/
static struct MHD_Daemon *mhd;
-/**
- * How long is caching /keys allowed at most? (global)
- */
-// struct GNUNET_TIME_Relative DH_max_keys_caching;
-
/**
* Our DB plugin. (global)
*/
@@ -136,11 +131,6 @@ int DH_global_ret;
*/
static uint16_t serve_port;
-/**
- * Counter for the number of requests this HTTP has processed so far.
- */
-// static unsigned long long req_count;
-
/**
* Counter for the number of open connections.
*/
@@ -177,25 +167,6 @@ typedef MHD_RESULT
const struct TALER_CoinSpendPublicKeyP *coin_pub,
const json_t *root);
-
-/**
- * Generate a 404 "not found" reply on @a connection with
- * the hint @a details.
- *
- * @param connection where to send the reply on
- * @param details details for the error message, can be NULL
- */
-// static MHD_RESULT
-// r404 (struct MHD_Connection *connection,
-// const char *details)
-// {
-// return TALER_MHD_reply_with_error (connection,
-// MHD_HTTP_NOT_FOUND,
-//
TALER_EC_EXCHANGE_GENERIC_OPERATION_UNKNOWN,
-// details);
-// }
-
-
/**
* Function called whenever MHD is done with a request. If the
* request was a POST, we may have stored a `struct Buffer *` in the
diff --git a/src/donau/donau-httpd_batch-issue.c
b/src/donau/donau-httpd_batch-issue.c
index c785e00..9c572b1 100644
--- a/src/donau/donau-httpd_batch-issue.c
+++ b/src/donau/donau-httpd_batch-issue.c
@@ -30,7 +30,6 @@
#include "donaudb_plugin.h"
#include "donau-httpd_batch-issue.h"
#include "donau-httpd_db.h"
-#include "donau-httpd_metrics.h"
#include "donau_json_lib.h"
#include "donau-httpd_keys.h"
@@ -72,7 +71,7 @@ parse_json_bkp (struct
DONAU_BlindedUniqueDonorIdentifierKeyPair *bkp,
* Parse signatures to JSON.
*
* @param num_sig number of signatures
- * @param signatures
+ * @param signatures Blinded donation unit signatures
* @param[out] j_signatures JSON object
* @return #GNUNET_OK if all is fine, #GNUNET_SYSERR if we could not parse
* is malformed.
@@ -202,13 +201,13 @@ DH_handler_issue_receipts_post (struct DH_RequestContext
*rc,
{
case GNUNET_DB_STATUS_HARD_ERROR:
case GNUNET_DB_STATUS_SOFT_ERROR:
- GNUNET_break_op (0);
+ GNUNET_break_op (0);
return TALER_MHD_reply_with_error (rc->connection,
MHD_HTTP_INTERNAL_SERVER_ERROR,
TALER_EC_GENERIC_DB_FETCH_FAILED,
NULL);
case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
- GNUNET_break_op (0);
+ GNUNET_break_op (0);
return TALER_MHD_reply_with_error (
rc->connection,
MHD_HTTP_NOT_FOUND,
@@ -305,7 +304,8 @@ start:
struct DH_DonationUnitKey *dk;
if (NULL == (dk = DH_keys_donation_unit_by_hash (
- &bkps[i].h_donation_unit_pub))) {
+ &bkps[i].h_donation_unit_pub)))
+ {
GNUNET_break_op (0);
return TALER_MHD_reply_with_error (rc->connection,
MHD_HTTP_NOT_FOUND,
@@ -333,8 +333,9 @@ start:
batch_sign_ec = DH_keys_donation_unit_batch_sign (num_bkps,
bkps_sign_data,
du_sigs);
- if (TALER_EC_NONE != batch_sign_ec) {
- GNUNET_break_op (0);
+ if (TALER_EC_NONE != batch_sign_ec)
+ {
+ GNUNET_break_op (0);
return TALER_MHD_reply_with_error (rc->connection,
MHD_HTTP_INTERNAL_SERVER_ERROR,
batch_sign_ec, // TODO:other EC
@@ -368,7 +369,8 @@ start:
second_time = true;
goto start;
case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
- if (! smaller_than_max_per_year) {
+ if (! smaller_than_max_per_year)
+ {
GNUNET_break_op (0);
return TALER_MHD_reply_with_error (rc->connection,
MHD_HTTP_BAD_REQUEST,
diff --git a/src/donau/donau-httpd_batch-submit.c
b/src/donau/donau-httpd_batch-submit.c
index ef8e1a2..5d9b7be 100644
--- a/src/donau/donau-httpd_batch-submit.c
+++ b/src/donau/donau-httpd_batch-submit.c
@@ -59,9 +59,8 @@ parse_json_dr (struct DONAU_DonationReceipt *dr,
&dr->h_donation_unit_pub),
GNUNET_JSON_spec_fixed_auto ("nonce",
&dr->nonce),
- // FIXME Need GNUNET_JSON_spec_unblinded_signature
- GNUNET_JSON_spec_fixed_auto ("donation_unit_sig",
- &dr->donation_unit_sig),
+ GNUNET_JSON_spec_unblinded_signature ("donation_unit_sig",
+ &dr->donation_unit_sig),
GNUNET_JSON_spec_end ()
};
diff --git a/src/donau/donau-httpd_batch-submit.h
b/src/donau/donau-httpd_batch-submit.h
index 08794e3..aa3ff6c 100644
--- a/src/donau/donau-httpd_batch-submit.h
+++ b/src/donau/donau-httpd_batch-submit.h
@@ -14,7 +14,7 @@
TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
/**
- * @file donau-httpd_submit-receipts.h
+ * @file donau-httpd_batch-submit.h
* @brief Handle /submit requests
* @author Johannes Casaburi
*/
diff --git a/src/donau/donau-httpd_charity_delete.c
b/src/donau/donau-httpd_charity_delete.c
index b76fa12..aaaa5e9 100644
--- a/src/donau/donau-httpd_charity_delete.c
+++ b/src/donau/donau-httpd_charity_delete.c
@@ -15,8 +15,7 @@
*/
/**
* @file donau-httpd_charity_delete.c
- * @brief Handle DELETE /charitys/$PID requests; parses the request and
- * verifies the signature before handing deletion to the database.
+ * @brief Handle DELETE /charitys/$CHARITY_ID requests.
* @author Johannes Casaburi
*/
#include "taler/platform.h"
@@ -27,12 +26,7 @@
#include "taler/taler_dbevents.h"
#include "taler/taler_json_lib.h"
#include "taler/taler_mhd_lib.h"
-// #include "donau-httpd_common_deposit.h"
#include "donau-httpd_charity.h"
-// #include "donau-httpd_responses.h"
-// #include "taler_exchangedb_lib.h"
-// #include "donau-httpd_keys.h"
-
MHD_RESULT
DH_handler_charity_delete (
diff --git a/src/donau/donau-httpd_charity_insert.c
b/src/donau/donau-httpd_charity_insert.c
index 7c3b027..3ba9d78 100644
--- a/src/donau/donau-httpd_charity_insert.c
+++ b/src/donau/donau-httpd_charity_insert.c
@@ -30,7 +30,6 @@
#include "donaudb_plugin.h"
#include "donau-httpd_charity.h"
#include "donau-httpd_db.h"
-#include "donau-httpd_metrics.h"
/**
@@ -143,7 +142,6 @@ DH_handler_charity_post (struct DH_RequestContext *rc,
if (GNUNET_OK !=
DH_DB_run_transaction (rc->connection,
"insert_charity",
- DH_MT_REQUEST_OTHER,
&mhd_ret,
&insert_charity,
&icc))
diff --git a/src/donau/donau-httpd_csr.c b/src/donau/donau-httpd_csr.c
index ee18314..394b8e7 100644
--- a/src/donau/donau-httpd_csr.c
+++ b/src/donau/donau-httpd_csr.c
@@ -19,9 +19,7 @@
/**
* @file donau-httpd_csr.c
* @brief Handle /csr requests
- * @author Lucien Heuzeveldt
- * @author Gian Demarmles
- * @author Christian Grothoff
+ * @author Johannes Casaburi
*/
#include <taler/platform.h>
#include <gnunet/gnunet_util_lib.h>
@@ -43,22 +41,22 @@
MHD_RESULT
DH_handler_csr_issue (struct DH_RequestContext *rc,
- const json_t *root,
- const char *const args[])
+ const json_t *root,
+ const char *const args[])
{
struct GNUNET_CRYPTO_CsSessionNonce nonce;
- struct TALER_DenominationHashP denom_pub_hash;
+ struct DONAU_DonationUnitHashP du_pub_hash;
struct GNUNET_CRYPTO_BlindingInputValues ewv = {
.cipher = GNUNET_CRYPTO_BSA_CS
};
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_fixed_auto ("nonce",
&nonce),
- GNUNET_JSON_spec_fixed_auto ("denom_pub_hash",
- &denom_pub_hash),
+ GNUNET_JSON_spec_fixed_auto ("du_pub_hash",
+ &du_pub_hash),
GNUNET_JSON_spec_end ()
};
- struct TEH_DenominationKey *dk;
+ struct DH_DonationUnitKey *dk;
(void) args;
{
@@ -72,9 +70,9 @@ DH_handler_csr_issue (struct DH_RequestContext *rc,
}
{
- struct TEH_KeyStateHandle *ksh;
+ struct DH_KeyStateHandle *ksh;
- ksh = TEH_keys_get_state ();
+ ksh = DH_keys_get_state ();
if (NULL == ksh)
{
return TALER_MHD_reply_with_error (rc->connection,
@@ -82,51 +80,42 @@ DH_handler_csr_issue (struct DH_RequestContext *rc,
TALER_EC_EXCHANGE_GENERIC_KEYS_MISSING,
NULL);
}
- dk = TEH_keys_denomination_by_hash_from_state (ksh,
- &denom_pub_hash,
- NULL,
- NULL);
+ dk = TEH_keys_donation_unit_by_hash_from_state (ksh,
+ &du_pub_hash,
+ NULL,
+ NULL);
if (NULL == dk)
{
- return TEH_RESPONSE_reply_unknown_denom_pub_hash (
+ return TEH_RESPONSE_reply_unknown_du_pub_hash (
rc->connection,
- &denom_pub_hash);
+ &du_pub_hash);
}
if (GNUNET_TIME_absolute_is_past (dk->meta.expire_withdraw.abs_time))
{
- /* This denomination is past the expiration time for
withdraws/refreshes*/
- return TEH_RESPONSE_reply_expired_denom_pub_hash (
+ /* This donation_unit is past the expiration time for
withdraws/refreshes*/
+ return TEH_RESPONSE_reply_expired_du_pub_hash (
rc->connection,
- &denom_pub_hash,
+ &du_pub_hash,
TALER_EC_EXCHANGE_GENERIC_DENOMINATION_EXPIRED,
"csr-withdraw");
}
if (GNUNET_TIME_absolute_is_future (dk->meta.start.abs_time))
{
- /* This denomination is not yet valid, no need to check
+ /* This donation_unit is not yet valid, no need to check
for idempotency! */
- return TEH_RESPONSE_reply_expired_denom_pub_hash (
+ return TEH_RESPONSE_reply_expired_du_pub_hash (
rc->connection,
- &denom_pub_hash,
+ &du_pub_hash,
TALER_EC_EXCHANGE_GENERIC_DENOMINATION_VALIDITY_IN_FUTURE,
"csr-withdraw");
}
- if (dk->recoup_possible)
- {
- /* This denomination has been revoked */
- return TEH_RESPONSE_reply_expired_denom_pub_hash (
- rc->connection,
- &denom_pub_hash,
- TALER_EC_EXCHANGE_GENERIC_DENOMINATION_REVOKED,
- "csr-withdraw");
- }
if (GNUNET_CRYPTO_BSA_CS !=
dk->denom_pub.bsign_pub_key->cipher)
{
- /* denomination is valid but not for CS */
+ /* donation_unit is valid but not for CS */
return TEH_RESPONSE_reply_invalid_denom_cipher_for_operation (
rc->connection,
- &denom_pub_hash);
+ &du_pub_hash);
}
}
@@ -134,13 +123,13 @@ DH_handler_csr_issue (struct DH_RequestContext *rc,
{
enum TALER_ErrorCode ec;
const struct TEH_CsDeriveData cdd = {
- .h_denom_pub = &denom_pub_hash,
+ .h_du_pub = &du_pub_hash,
.nonce = &nonce
};
- ec = TEH_keys_denomination_cs_r_pub (&cdd,
- false,
- &ewv.details.cs_values);
+ ec = TEH_keys_donation_unit_cs_r_pub (&cdd,
+ false,
+ &ewv.details.cs_values);
if (TALER_EC_NONE != ec)
{
GNUNET_break (0);
diff --git a/src/donau/donau-httpd_csr.h b/src/donau/donau-httpd_csr.h
index 3a6cc18..a3e7e39 100644
--- a/src/donau/donau-httpd_csr.h
+++ b/src/donau/donau-httpd_csr.h
@@ -16,8 +16,7 @@
/**
* @file donau-httpd_csr.h
* @brief Handle /csr-* requests
- * @author Lucien Heuzeveldt
- * @author Gian Demarmles
+ * @author Johannes Casaburi
*/
#ifndef DONAU_HTTPD_CSR_H
#define DONAU_HTTPD_CSR_H
@@ -37,7 +36,7 @@
*/
MHD_RESULT
DH_handler_csr_issue (struct DH_RequestContext *rc,
- const json_t *root,
- const char *const args[]);
+ const json_t *root,
+ const char *const args[]);
#endif
diff --git a/src/donau/donau-httpd_db.c b/src/donau/donau-httpd_db.c
index 09490d2..56fba7e 100644
--- a/src/donau/donau-httpd_db.c
+++ b/src/donau/donau-httpd_db.c
@@ -16,7 +16,7 @@
/**
* @file donau-httpd_db.c
* @brief Generic database operations for the donau.
- * @author Christian Grothoff
+ * @author Johannes Casaburi
*/
#include <taler/platform.h>
#include <pthread.h>
@@ -26,13 +26,12 @@
#include <taler/taler_mhd_lib.h>
#include "donaudb_lib.h"
#include "donau-httpd_db.h"
-// #include "donau-httpd_responses.h"
+#include "donau-httpd.h"
enum GNUNET_GenericReturnValue
DH_DB_run_transaction (struct MHD_Connection *connection,
const char *name,
- enum DH_MetricTypeRequest mt,
MHD_RESULT *mhd_ret,
DH_DB_TransactionCallback cb,
void *cb_cls)
@@ -50,8 +49,6 @@ DH_DB_run_transaction (struct MHD_Connection *connection,
NULL);
return GNUNET_SYSERR;
}
- GNUNET_assert (mt < DH_MT_REQUEST_COUNT);
- DH_METRICS_num_requests[mt]++;
for (unsigned int retries = 0;
retries < MAX_TRANSACTION_COMMIT_RETRIES;
retries++)
@@ -100,7 +97,6 @@ DH_DB_run_transaction (struct MHD_Connection *connection,
(-1 == (int) *mhd_ret) );
if (0 <= qs)
return GNUNET_OK;
- DH_METRICS_num_conflict[mt]++;
}
DH_plugin->rollback (DH_plugin->cls);
TALER_LOG_ERROR ("Transaction `%s' commit failed %u times\n",
diff --git a/src/donau/donau-httpd_db.h b/src/donau/donau-httpd_db.h
index ac21e5c..a8f0a0e 100644
--- a/src/donau/donau-httpd_db.h
+++ b/src/donau/donau-httpd_db.h
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2014-2017 Taler Systems SA
+ Copyright (C) 2024 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
@@ -16,14 +16,12 @@
/**
* @file donau/donau-httpd_db.h
* @brief High-level (transactional-layer) database operations for the donau
- * @author Chrisitan Grothoff
+ * @author Johannes Casaburi
*/
#ifndef DONAU_HTTPD_DB_H
#define DONAU_HTTPD_DB_H
#include <microhttpd.h>
-// #include "donaudb_plugin.h"
-#include "donau-httpd_metrics.h"
#include <gnunet/gnunet_mhd_compat.h>
@@ -40,22 +38,6 @@
#define MAX_TRANSACTION_COMMIT_RETRIES 100
-/**
- * Ensure coin is known in the database, and handle conflicts and errors.
- *
- * @param coin the coin to make known
- * @param connection MHD request context
- * @param[out] known_coin_id set to the unique ID for the coin in the DB
- * @param[out] mhd_ret set to MHD status on error
- * @return transaction status, negative on error (@a mhd_ret will be set in
this case)
- */
-enum GNUNET_DB_QueryStatus
-DH_make_coin_known (const struct TALER_CoinPublicInfo *coin,
- struct MHD_Connection *connection,
- uint64_t *known_coin_id,
- MHD_RESULT *mhd_ret);
-
-
/**
* Function implementing a database transaction. Runs the transaction
* logic; IF it returns a non-error code, the transaction logic MUST
@@ -85,7 +67,6 @@ typedef enum GNUNET_DB_QueryStatus
*
* @param connection MHD connection to run @a cb for, can be NULL
* @param name name of the transaction (for debugging)
- * @param mt type of the requests, for metric generation
* @param[out] mhd_ret set to MHD response code, if transaction failed
(returned #GNUNET_SYSERR);
* NULL if we are not running with a @a connection and thus
* must not queue MHD replies
@@ -96,7 +77,6 @@ typedef enum GNUNET_DB_QueryStatus
enum GNUNET_GenericReturnValue
DH_DB_run_transaction (struct MHD_Connection *connection,
const char *name,
- enum DH_MetricTypeRequest mt,
MHD_RESULT *mhd_ret,
DH_DB_TransactionCallback cb,
void *cb_cls);
diff --git a/src/donau/donau-httpd_history_get.c
b/src/donau/donau-httpd_history_get.c
index 4ac2d77..35c7b4a 100644
--- a/src/donau/donau-httpd_history_get.c
+++ b/src/donau/donau-httpd_history_get.c
@@ -28,13 +28,12 @@
#include "donau-httpd.h"
#include "donaudb_plugin.h"
#include "donau-httpd_history.h"
-// #include "taler-exchange-httpd_metrics.h"
/**
* Maximum number of history we return per request.
*/
-#define MAX_RECORDS 1024
+// #define MAX_RECORDS 1024
/**
* Return history information.
diff --git a/src/donau/donau-httpd_keys.c b/src/donau/donau-httpd_keys.c
index 018c096..bbf1a4d 100644
--- a/src/donau/donau-httpd_keys.c
+++ b/src/donau/donau-httpd_keys.c
@@ -326,7 +326,7 @@ struct KeysBuilderContext
* Function called for all signing keys, used to build up the
* respective JSON response.
*
- * @param cls a `struct SignKeyCtx *` with the array to append keys to
+ * @param cls a `struct KeysBuilderContext *` with the array to append keys to
* @param pid the donau public key (in type disguise)
* @param value a `struct SigningKey`
* @return #GNUNET_OK (continue to iterate)
@@ -361,7 +361,7 @@ add_sign_key_cb (void *cls,
* and adds the remaining donation unit keys (with their configuration
* data) to the JSON array.
*
- * @param cls the `struct FutureBuilderContext *`
+ * @param cls the `struct KeysBuilderContext *`
* @param h_du_pub hash of the donation unit public key
* @param value a `struct DH_DonationUnitKey`
* @return #GNUNET_OK (continue to iterate)
diff --git a/src/donau/donau-httpd_keys.h b/src/donau/donau-httpd_keys.h
index e7dacb9..06089d9 100644
--- a/src/donau/donau-httpd_keys.h
+++ b/src/donau/donau-httpd_keys.h
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2020-2023 Taler Systems SA
+ Copyright (C) 2023-2024 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
@@ -21,7 +21,6 @@
#include <taler/platform.h>
#include <taler/taler_json_lib.h>
#include <taler/taler_mhd_lib.h>
-// #include "donau-httpd_responses.h"
#include "donau_util.h"
#include "donaudb_plugin.h"
#include "donau-httpd.h"
@@ -82,15 +81,15 @@ struct DH_BlindSignData
};
/**
- * Sign the message in @a purpose with the exchange's signing key.
+ * Sign the message in @a purpose with the doanu's signing key.
*
* The @a purpose data is the beginning of the data of which the signature is
* to be created. The `size` field in @a purpose must correctly indicate the
* number of bytes of the data structure, including its header. Use
- * #TEH_keys_exchange_sign() instead of calling this function directly!
+ * #DH_keys_doanu_sign() instead of calling this function directly!
*
* @param purpose the message to sign
- * @param[out] pub set to the current public signing key of the exchange
+ * @param[out] pub set to the current public signing key of the doanu
* @param[out] sig signature over purpose using current signing key
* @return #TALER_EC_NONE on success
*/
@@ -114,7 +113,7 @@ DH_keys_donau_sign_ (
* @return #TALER_EC_NONE on success
*/
#define DH_keys_donau_sign(ps,pub,sig) \
- ({ \
+ ({ \
/* check size is set correctly */ \
GNUNET_assert (htonl ((ps)->purpose.size) == \
sizeof (*ps)); \
@@ -153,8 +152,6 @@ DH_handler_keys (struct DH_RequestContext *rc,
* Look up the issue for a donation unit public key.
*
* @param h_du_pub hash of donation unit public key
- * @param[in,out] conn used to return status message if NULL is returned
- * @param[out] mret set to the MHD status if NULL is returned
* @return the donation unit key issue,
* or NULL if @a h_du_pub could not be found
*/
diff --git a/src/donau/donau-httpd_metrics.c b/src/donau/donau-httpd_metrics.c
deleted file mode 100644
index a1960a6..0000000
--- a/src/donau/donau-httpd_metrics.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- This file is part of TALER
- Copyright (C) 2015-2021 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 Affero General Public License for more
details.
-
- You should have received a copy of the GNU Affero General Public License
along with
- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
-*/
-/**
- * @file donau-httpd_metrics.c
- * @brief Handle /metrics requests
- * @author Christian Grothoff
- */
-#include <taler/platform.h>
-#include <gnunet/gnunet_json_lib.h>
-#include <taler/taler_dbevents.h>
-// #include "donau-httpd_responses.h"
-#include "donau-httpd_keys.h"
-#include "donau-httpd_metrics.h"
-#include <taler/taler_json_lib.h>
-#include <taler/taler_mhd_lib.h>
-#include <jansson.h>
-
-
-unsigned long long DH_METRICS_num_requests[DH_MT_REQUEST_COUNT];
-
-unsigned long long DH_METRICS_batch_withdraw_num_coins;
-
-unsigned long long DH_METRICS_num_conflict[DH_MT_REQUEST_COUNT];
-
-unsigned long long DH_METRICS_num_signatures[DH_MT_SIGNATURE_COUNT];
-
-unsigned long long DH_METRICS_num_verifications[DH_MT_SIGNATURE_COUNT];
-
-unsigned long long DH_METRICS_num_keyexchanges[DH_MT_KEYX_COUNT];
-
-unsigned long long DH_METRICS_num_success[DH_MT_SUCCESS_COUNT];
-
-
-MHD_RESULT
-DH_handler_metrics (struct DH_RequestContext *rc,
- const char *const args[])
-{
- char *reply;
- struct MHD_Response *resp;
- MHD_RESULT ret;
-
- (void) args;
- GNUNET_asprintf (&reply,
- "taler_exchange_success_transactions{type=\"%s\"} %llu\n"
- "taler_exchange_success_transactions{type=\"%s\"} %llu\n"
- "taler_exchange_success_transactions{type=\"%s\"} %llu\n"
- "taler_exchange_success_transactions{type=\"%s\"} %llu\n"
- "taler_exchange_success_transactions{type=\"%s\"} %llu\n"
- "# HELP taler_exchange_serialization_failures "
- " number of database serialization errors by type\n"
- "# TYPE taler_exchange_serialization_failures counter\n"
- "taler_exchange_serialization_failures{type=\"%s\"} %llu\n"
- "taler_exchange_serialization_failures{type=\"%s\"} %llu\n"
- "taler_exchange_serialization_failures{type=\"%s\"} %llu\n"
- "taler_exchange_serialization_failures{type=\"%s\"} %llu\n"
- "# HELP taler_exchange_received_requests "
- " number of received requests by type\n"
- "# TYPE taler_exchange_received_requests counter\n"
- "taler_exchange_received_requests{type=\"%s\"} %llu\n"
- "taler_exchange_received_requests{type=\"%s\"} %llu\n"
- "taler_exchange_received_requests{type=\"%s\"} %llu\n"
- "taler_exchange_received_requests{type=\"%s\"} %llu\n"
- "taler_exchange_idempotent_requests{type=\"%s\"} %llu\n"
-#if NOT_YET_IMPLEMENTED
- "taler_exchange_idempotent_requests{type=\"%s\"} %llu\n"
- "taler_exchange_idempotent_requests{type=\"%s\"} %llu\n"
-#endif
- "taler_exchange_idempotent_requests{type=\"%s\"} %llu\n"
- "# HELP taler_exchange_num_signatures "
- " number of signatures created by cipher\n"
- "# TYPE taler_exchange_num_signatures counter\n"
- "taler_exchange_num_signatures{type=\"%s\"} %llu\n"
- "taler_exchange_num_signatures{type=\"%s\"} %llu\n"
- "taler_exchange_num_signatures{type=\"%s\"} %llu\n"
- "# HELP taler_exchange_num_signature_verifications "
- " number of signatures verified by cipher\n"
- "# TYPE taler_exchange_num_signature_verifications
counter\n"
- "taler_exchange_num_signature_verifications{type=\"%s\"}
%llu\n"
- "taler_exchange_num_signature_verifications{type=\"%s\"}
%llu\n"
- "taler_exchange_num_signature_verifications{type=\"%s\"}
%llu\n"
- "# HELP taler_exchange_num_keyexchanges "
- " number of key exchanges done by cipher\n"
- "# TYPE taler_exchange_num_keyexchanges counter\n"
- "taler_exchange_num_keyexchanges{type=\"%s\"} %llu\n"
- "# HELP taler_exchange_batch_withdraw_num_coins "
- " number of coins withdrawn in a batch-withdraw request\n"
- "# TYPE taler_exchange_batch_withdraw_num_coins counter\n"
- "taler_exchange_batch_withdraw_num_coins{} %llu\n",
- "deposit",
- DH_METRICS_num_success[DH_MT_SUCCESS_DEPOSIT],
- "withdraw",
- DH_METRICS_num_success[DH_MT_SUCCESS_WITHDRAW],
- "batch-withdraw",
- DH_METRICS_num_success[DH_MT_SUCCESS_BATCH_WITHDRAW],
- "melt",
- DH_METRICS_num_success[DH_MT_SUCCESS_MELT],
- "refresh-reveal",
- DH_METRICS_num_success[DH_MT_SUCCESS_REFRESH_REVEAL],
- "other",
- DH_METRICS_num_conflict[DH_MT_REQUEST_OTHER],
- "deposit",
- DH_METRICS_num_conflict[DH_MT_REQUEST_DEPOSIT],
- "withdraw",
- DH_METRICS_num_conflict[DH_MT_REQUEST_WITHDRAW],
- "melt",
- DH_METRICS_num_conflict[DH_MT_REQUEST_MELT],
- "other",
- DH_METRICS_num_requests[DH_MT_REQUEST_OTHER],
- "deposit",
- DH_METRICS_num_requests[DH_MT_REQUEST_DEPOSIT],
- "withdraw",
- DH_METRICS_num_requests[DH_MT_REQUEST_WITHDRAW],
- "melt",
- DH_METRICS_num_requests[DH_MT_REQUEST_MELT],
- "withdraw",
- DH_METRICS_num_requests[DH_MT_REQUEST_IDEMPOTENT_WITHDRAW],
-#if NOT_YET_IMPLEMENTED
- "deposit",
- DH_METRICS_num_requests[DH_MT_REQUEST_IDEMPOTENT_DEPOSIT],
- "melt",
- DH_METRICS_num_requests[DH_MT_REQUEST_IDEMPOTENT_MELT],
-#endif
- "batch-withdraw",
- DH_METRICS_num_requests[
- DH_MT_REQUEST_IDEMPOTENT_BATCH_WITHDRAW],
- "rsa",
- DH_METRICS_num_signatures[DH_MT_SIGNATURE_RSA],
- "cs",
- DH_METRICS_num_signatures[DH_MT_SIGNATURE_CS],
- "eddsa",
- DH_METRICS_num_signatures[DH_MT_SIGNATURE_EDDSA],
- "rsa",
- DH_METRICS_num_verifications[DH_MT_SIGNATURE_RSA],
- "cs",
- DH_METRICS_num_verifications[DH_MT_SIGNATURE_CS],
- "eddsa",
- DH_METRICS_num_verifications[DH_MT_SIGNATURE_EDDSA],
- "ecdh",
- DH_METRICS_num_keyexchanges[DH_MT_KEYX_ECDH],
- DH_METRICS_batch_withdraw_num_coins);
- resp = MHD_create_response_from_buffer (strlen (reply),
- reply,
- MHD_RESPMEM_MUST_FREE);
- ret = MHD_queue_response (rc->connection,
- MHD_HTTP_OK,
- resp);
- MHD_destroy_response (resp);
- return ret;
-}
-
-
-/* end of donau-httpd_metrics.c */
diff --git a/src/donau/donau-httpd_metrics.h b/src/donau/donau-httpd_metrics.h
deleted file mode 100644
index ee2149b..0000000
--- a/src/donau/donau-httpd_metrics.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- This file is part of TALER
- Copyright (C) 2014--2021 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 Affero General Public License for more
details.
-
- You should have received a copy of the GNU Affero General Public License
along with
- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
-*/
-/**
- * @file donau-httpd_metrics.h
- * @brief Handle /metrics requests
- * @author Christian Grothoff
- */
-#ifndef DONAU_HTTPD_METRICS_H
-#define DONAU_HTTPD_METRICS_H
-
-#include <gnunet/gnunet_util_lib.h>
-#include <microhttpd.h>
-#include "donau-httpd.h"
-
-
-/**
- * Request types for which we collect metrics.
- */
-enum DH_MetricTypeRequest
-{
- DH_MT_REQUEST_OTHER = 0,
- DH_MT_REQUEST_DEPOSIT = 1,
- DH_MT_REQUEST_WITHDRAW = 2,
- DH_MT_REQUEST_AGE_WITHDRAW = 3,
- DH_MT_REQUEST_MELT = 4,
- DH_MT_REQUEST_PURSE_CREATE = 5,
- DH_MT_REQUEST_PURSE_MERGE = 6,
- DH_MT_REQUEST_RESERVE_PURSE = 7,
- DH_MT_REQUEST_PURSE_DEPOSIT = 8,
- DH_MT_REQUEST_IDEMPOTENT_DEPOSIT = 9,
- DH_MT_REQUEST_IDEMPOTENT_WITHDRAW = 10,
- DH_MT_REQUEST_IDEMPOTENT_AGE_WITHDRAW = 11,
- DH_MT_REQUEST_IDEMPOTENT_MELT = 12,
- DH_MT_REQUEST_IDEMPOTENT_BATCH_WITHDRAW = 13,
- DH_MT_REQUEST_BATCH_DEPOSIT = 14,
- DH_MT_REQUEST_POLICY_FULFILLMENT = 15,
- DH_MT_REQUEST_COUNT = 16 /* MUST BE LAST! */
-};
-
-/**
- * Success types for which we collect metrics.
- */
-enum DH_MetricTypeSuccess
-{
- DH_MT_SUCCESS_DEPOSIT = 0,
- DH_MT_SUCCESS_WITHDRAW = 1,
- DH_MT_SUCCESS_AGE_WITHDRAW = 2,
- DH_MT_SUCCESS_BATCH_WITHDRAW = 3,
- DH_MT_SUCCESS_MELT = 4,
- DH_MT_SUCCESS_REFRESH_REVEAL = 5,
- DH_MT_SUCCESS_AGE_WITHDRAW_REVEAL = 6,
- DH_MT_SUCCESS_COUNT = 7 /* MUST BE LAST! */
-};
-
-/**
- * Cipher types for which we collect signature metrics.
- */
-enum DH_MetricTypeSignature
-{
- DH_MT_SIGNATURE_RSA = 0,
- DH_MT_SIGNATURE_CS = 1,
- DH_MT_SIGNATURE_EDDSA = 2,
- DH_MT_SIGNATURE_COUNT = 3
-};
-
-/**
- * Cipher types for which we collect key exchange metrics.
- */
-enum DH_MetricTypeKeyX
-{
- DH_MT_KEYX_ECDH = 0,
- DH_MT_KEYX_COUNT = 1
-};
-
-/**
- * Number of requests handled of the respective type.
- */
-extern unsigned long long DH_METRICS_num_requests[DH_MT_REQUEST_COUNT];
-
-/**
- * Number of successful requests handled of the respective type.
- */
-extern unsigned long long DH_METRICS_num_success[DH_MT_SUCCESS_COUNT];
-
-/**
- * Number of coins withdrawn in a batch-withdraw request
- */
-extern unsigned long long DH_METRICS_batch_withdraw_num_coins;
-
-/**
- * Number of serialization errors encountered when
- * handling requests of the respective type.
- */
-extern unsigned long long DH_METRICS_num_conflict[DH_MT_REQUEST_COUNT];
-
-/**
- * Number of signatures created by the respective cipher.
- */
-extern unsigned long long DH_METRICS_num_signatures[DH_MT_SIGNATURE_COUNT];
-
-/**
- * Number of signatures verified by the respective cipher.
- */
-extern unsigned long long DH_METRICS_num_verifications[DH_MT_SIGNATURE_COUNT];
-
-/**
- * Number of key exchanges done with the respective cipher.
- */
-extern unsigned long long DH_METRICS_num_keyexchanges[DH_MT_KEYX_COUNT];
-
-/**
- * Handle a "/metrics" request.
- *
- * @param rc request context
- * @param args array of additional options (must be empty for this function)
- * @return MHD result code
- */
-MHD_RESULT
-DH_handler_metrics (struct DH_RequestContext *rc,
- const char *const args[]);
-
-
-#endif
diff --git a/src/donau/donau-httpd_mhd.c b/src/donau/donau-httpd_mhd.c
index baec9f7..0d088ab 100644
--- a/src/donau/donau-httpd_mhd.c
+++ b/src/donau/donau-httpd_mhd.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2014-2020 Taler Systems SA
+ Copyright (C) 2024 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
diff --git a/src/donau/donau-httpd_mhd.h b/src/donau/donau-httpd_mhd.h
index e47c410..9c50b6e 100644
--- a/src/donau/donau-httpd_mhd.h
+++ b/src/donau/donau-httpd_mhd.h
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2014-2022 Taler Systems SA
+ Copyright (C) 2024 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
diff --git a/src/donau/donau-httpd_terms.c b/src/donau/donau-httpd_terms.c
index 673392e..8a99fdf 100644
--- a/src/donau/donau-httpd_terms.c
+++ b/src/donau/donau-httpd_terms.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2019, 2021 Taler Systems SA
+ Copyright (C) 2024 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
@@ -25,7 +25,6 @@
#include <microhttpd.h>
#include <taler/taler_mhd_lib.h>
#include "donau-httpd_terms.h"
-// #include "donau-httpd_responses.h"
/**
* Our terms of service.
diff --git a/src/donau/donau-httpd_terms.h b/src/donau/donau-httpd_terms.h
index 8372509..d966bd8 100644
--- a/src/donau/donau-httpd_terms.h
+++ b/src/donau/donau-httpd_terms.h
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2019, 2021 Taler Systems SA
+ Copyright (C) 2024 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
@@ -27,7 +27,6 @@
#include <microhttpd.h>
#include <taler/taler_mhd_lib.h>
#include "donau-httpd.h"
-// #include "donau-httpd_responses.h"
/**
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-donau] branch master updated: minor changes, rm metrics,
gnunet <=