merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit e5deadc03602af49c65432d4fcbb5347f739fa1a
parent c2f92c42c65346bde0bd5af01fbad51b2600a496
Author: Christian Grothoff <christian@grothoff.org>
Date:   Wed,  4 Aug 2021 19:24:35 +0200

-improve logging

Diffstat:
Msrc/backend/taler-merchant-httpd.c | 29++++++++++++++++++++++-------
1 file changed, 22 insertions(+), 7 deletions(-)

diff --git a/src/backend/taler-merchant-httpd.c b/src/backend/taler-merchant-httpd.c @@ -796,10 +796,28 @@ handle_mhd_completion_callback (void *cls, if (NULL == hc) return; GNUNET_SCHEDULER_begin_async_scope (&hc->async_scope_id); - GNUNET_log (GNUNET_ERROR_TYPE_INFO, - "Finished handling request for `%s' with MHD termination code %d\n", - hc->url, - (int) toe); + { +#ifdef MHD_CONNECTION_INFO_HTTP_STATUS + const union MHD_ConnectionInfo *ci; + unsigned int http_status = 0; + + ci = MHD_get_connection_info (connection, + MHD_CONNECTION_INFO_HTTP_STATUS); + if (NULL != ci) + http_status = ci->http_status; + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Request for `%s' completed with HTTP status %u (%d)\n", + hc->url, + http_status, + toe); +#else + (void) connection; + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Finished handling request for `%s' with MHD termination code %d\n", + hc->url, + (int) toe); +#endif + } if (NULL != hc->cc) hc->cc (hc->ctx); TALER_MHD_parse_post_cleanup_callback (hc->json_parse_context); @@ -808,9 +826,6 @@ handle_mhd_completion_callback (void *cls, json_decref (hc->request_body); if (NULL != hc->instance) instance_decref (hc->instance); - memset (&hc->async_scope_id, - 0, - sizeof (struct GNUNET_AsyncScopeId)); GNUNET_free (hc); *con_cls = NULL; }