summaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-httpd.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-08-04 19:24:35 +0200
committerChristian Grothoff <christian@grothoff.org>2021-08-04 19:24:35 +0200
commite5deadc03602af49c65432d4fcbb5347f739fa1a (patch)
treeb6a3a453a99b9bc2dfe22faff4ed00b57c53d3d7 /src/backend/taler-merchant-httpd.c
parentc2f92c42c65346bde0bd5af01fbad51b2600a496 (diff)
downloadmerchant-e5deadc03602af49c65432d4fcbb5347f739fa1a.tar.gz
merchant-e5deadc03602af49c65432d4fcbb5347f739fa1a.tar.bz2
merchant-e5deadc03602af49c65432d4fcbb5347f739fa1a.zip
-improve logging
Diffstat (limited to 'src/backend/taler-merchant-httpd.c')
-rw-r--r--src/backend/taler-merchant-httpd.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/src/backend/taler-merchant-httpd.c b/src/backend/taler-merchant-httpd.c
index 3d63ed46..ed782f33 100644
--- 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;
}