[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] 06/12: more precise logging
From: |
gnunet |
Subject: |
[taler-exchange] 06/12: more precise logging |
Date: |
Sat, 29 Feb 2020 16:59:25 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
commit 502c9a0fc36bf8ee81e294827c7403519e174249
Author: Christian Grothoff <address@hidden>
AuthorDate: Wed Feb 26 23:43:32 2020 +0100
more precise logging
---
src/exchange/taler-exchange-httpd.c | 27 ++++++++++++++++++++++-----
1 file changed, 22 insertions(+), 5 deletions(-)
diff --git a/src/exchange/taler-exchange-httpd.c
b/src/exchange/taler-exchange-httpd.c
index 5374dbd5..051fb969 100644
--- a/src/exchange/taler-exchange-httpd.c
+++ b/src/exchange/taler-exchange-httpd.c
@@ -358,6 +358,7 @@ proceed_with_handler (const struct TEH_RequestHandler *rh,
if (rh->nargs > 0)
{
unsigned int i;
+ const char *fin;
/* make a copy of 'url' because 'strtok()' will modify */
memcpy (d,
@@ -372,13 +373,24 @@ proceed_with_handler (const struct TEH_RequestHandler *rh,
that there is no excess data in 'd' afterwards */
if ( (i != rh->nargs) ||
(NULL == args[i - 1]) ||
- (NULL != strtok (NULL, "/")) )
+ (NULL != (fin = strtok (NULL, "/"))) )
{
+ char emsg[128 + 512];
+
+ GNUNET_snprintf (emsg,
+ sizeof (emsg),
+ "Got %u/%u segments for %s request ('%s')",
+ (NULL == args[i - 1])
+ ? i - 1
+ : i + ((NULL != fin) ? 1 : 0),
+ rh->nargs,
+ rh->url,
+ url);
GNUNET_break_op (0);
return TALER_MHD_reply_with_error (connection,
MHD_HTTP_NOT_FOUND,
TALER_EC_WRONG_NUMBER_OF_SEGMENTS,
- "Number of segments does not
match");
+ emsg);
}
}
@@ -471,7 +483,7 @@ handle_mhd_request (void *cls,
},
/* Return key material and fundamental properties for this exchange */
{
- .url = "/keys",
+ .url = "keys",
.method = MHD_HTTP_METHOD_GET,
.handler.get = &TEH_KS_handler_keys,
},
@@ -590,10 +602,15 @@ handle_mhd_request (void *cls,
if (NULL != ecls->rh)
{
int ret;
+ const char *start;
+ if ('\0' == url[0])
+ /* strange, should start with '/', treat as just "/" */
+ url = "/";
+ start = strchr (url + 1, '/');
ret = proceed_with_handler (ecls->rh,
connection,
- url,
+ start,
inner_cls,
upload_data,
upload_data_size);
@@ -619,7 +636,7 @@ handle_mhd_request (void *cls,
rest = strchr (tok, '/');
if (NULL == rest)
{
- tok_size = 0;
+ tok_size = strlen (tok);
}
else
{
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [taler-exchange] branch master updated (30b24448 -> cdc8c5b5), gnunet, 2020/02/29
- [taler-exchange] 04/12: fix shutdown logic if shutdown happens during startup, gnunet, 2020/02/29
- [taler-exchange] 03/12: fix uninitialized local, gnunet, 2020/02/29
- [taler-exchange] 09/12: nicer logging, gnunet, 2020/02/29
- [taler-exchange] 05/12: fix failure to remove rc from JSON, gnunet, 2020/02/29
- [taler-exchange] 06/12: more precise logging,
gnunet <=
- [taler-exchange] 08/12: skip also here over part of URI that was already parsed, gnunet, 2020/02/29
- [taler-exchange] 07/12: proper generation of /refreshes/ requests, gnunet, 2020/02/29
- [taler-exchange] 02/12: updating libtalerexchange to new REST API (#6067), gnunet, 2020/02/29
- [taler-exchange] 10/12: rename fest, make symbols better match new endpoint names, gnunet, 2020/02/29
- [taler-exchange] 12/12: limit redirects, gnunet, 2020/02/29
- [taler-exchange] 01/12: phase 1 of #6067: update exchange HTTPD to new API style, gnunet, 2020/02/29
- [taler-exchange] 11/12: big rename fest related to #6067 API renaming, gnunet, 2020/02/29