commit 35caab4eec4cd11816acc9a49defe3df3c475c91
parent ff7219b81c9e00e546b44a122f25df709bf96e2f
Author: Christian Grothoff <christian@grothoff.org>
Date: Wed, 14 Feb 2024 10:50:20 +0100
improve logging
Diffstat:
5 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/src/challenger/challenger-httpd.c b/src/challenger/challenger-httpd.c
@@ -1,6 +1,6 @@
/*
This file is part of Challenger
- (C) 2023 Taler Systems SA
+ (C) 2023, 2024 Taler Systems SA
Challenger 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
@@ -377,14 +377,18 @@ handle_mhd_completion_callback (void *cls,
enum MHD_RequestTerminationCode toe)
{
struct CH_HandlerContext *hc = *con_cls;
+ const union MHD_ConnectionInfo *ci;
(void) cls;
if (NULL == hc)
return;
GNUNET_assert (hc->connection == connection);
+ ci = MHD_get_connection_info (connection,
+ MHD_CONNECTION_INFO_HTTP_STATUS);
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "Finished handling request with status %d\n",
- (int) toe);
+ "Finished handling request with status %d (HTTP status %u)\n",
+ (int) toe,
+ ci->http_status);
if (NULL != hc->cc)
hc->cc (hc->ctx);
GNUNET_free (hc);
diff --git a/src/challenger/challenger-httpd.h b/src/challenger/challenger-httpd.h
@@ -83,6 +83,7 @@ struct CH_HandlerContext
* Asynchronous request context id.
*/
struct GNUNET_AsyncScopeId async_scope_id;
+
};
diff --git a/src/challenger/challenger-httpd_authorize.c b/src/challenger/challenger-httpd_authorize.c
@@ -162,6 +162,7 @@ CH_handler_authorize (struct CH_HandlerContext *hc,
GNUNET_break (0);
return MHD_NO;
case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
+ GNUNET_break_op (0);
return TALER_TEMPLATING_reply_error (hc->connection,
"validation-unknown",
MHD_HTTP_NOT_FOUND,
diff --git a/src/challenger/challenger-httpd_challenge.c b/src/challenger/challenger-httpd_challenge.c
@@ -539,6 +539,7 @@ CH_handler_challenge (struct CH_HandlerContext *hc,
GNUNET_break (0);
return MHD_NO;
case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
+ GNUNET_break_op (0);
return TALER_TEMPLATING_reply_error (hc->connection,
"validation-unknown",
MHD_HTTP_NOT_FOUND,
diff --git a/src/challenger/challenger-httpd_setup.c b/src/challenger/challenger-httpd_setup.c
@@ -120,6 +120,16 @@ CH_handler_setup (struct CH_HandlerContext *hc,
case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
break;
}
+ {
+ char *nstr;
+
+ nstr = GNUNET_STRINGS_data_to_string_alloc (&nonce,
+ sizeof (nonce));
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "/setup returns nonce `%s'\n",
+ nstr);
+ GNUNET_free (nstr);
+ }
return TALER_MHD_REPLY_JSON_PACK (
hc->connection,
MHD_HTTP_OK,