commit 8895938a05feb7e7156f1cbbceb34d40a59cde72
parent 7192d66b632be5d1732fa121baa5f79483ad2721
Author: Christian Grothoff <christian@grothoff.org>
Date: Sat, 30 Aug 2025 23:36:56 +0200
-fix compiler warnings
Diffstat:
3 files changed, 31 insertions(+), 32 deletions(-)
diff --git a/src/backend/taler-merchant-donaukeyupdate.c b/src/backend/taler-merchant-donaukeyupdate.c
@@ -710,28 +710,29 @@ force_donau_charity_id (void *cls,
const void *extra,
size_t extra_len)
{
- if ( (sizeof(uint64_t) != extra_len)
- || (NULL == extra) )
+ uint64_t di_serial;
+ char *donau_url = NULL;
+ uint64_t charity_id = -1;
+ enum GNUNET_DB_QueryStatus qs;
+ struct ForceCharityCtx *fcc;
+
+ if ( (sizeof(uint64_t) != extra_len) ||
+ (NULL == extra) )
{
GNUNET_break (0);
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Incorrect extra for the force_donau_charity_id");
return;
}
- uint64_t di_serial;
- char *donau_url = NULL;
- uint64_t charity_id = -1;
-
GNUNET_memcpy (&di_serial,
extra,
sizeof(uint64_t));
di_serial = GNUNET_ntohll (di_serial);
- enum GNUNET_DB_QueryStatus qs =
- db_plugin->select_donau_instance_by_serial (db_plugin->cls,
- di_serial,
- &donau_url,
- &charity_id);
+ qs = db_plugin->select_donau_instance_by_serial (db_plugin->cls,
+ di_serial,
+ &donau_url,
+ &charity_id);
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != qs)
{
@@ -743,8 +744,7 @@ force_donau_charity_id (void *cls,
return;
}
- struct ForceCharityCtx *fcc =
- lookup_donau_charity (di_serial);
+ fcc = lookup_donau_charity (di_serial);
if (NULL == fcc)
{
fcc = GNUNET_new (struct ForceCharityCtx);
@@ -771,7 +771,6 @@ force_donau_charity_id (void *cls,
return;
}
}
-
download_charity_id (fcc);
}
@@ -1041,4 +1040,4 @@ main (int argc,
}
-/* end of taler-merchant-donaukeyupdate.c */
-\ No newline at end of file
+/* end of taler-merchant-donaukeyupdate.c */
diff --git a/src/backend/taler-merchant-httpd_private-post-donau-instance.c b/src/backend/taler-merchant-httpd_private-post-donau-instance.c
@@ -85,6 +85,7 @@ static struct PostDonauCtx *pdc_head;
*/
static struct PostDonauCtx *pdc_tail;
+
/**
* Callback for DONAU_charities_get() to handle the response.
*
@@ -96,14 +97,13 @@ donau_charity_get_cb (void *cls,
const struct DONAU_GetCharityResponse *gcr)
{
struct PostDonauCtx *pdc = cls;
+ enum GNUNET_DB_QueryStatus qs;
+
pdc->get_handle = NULL;
if (NULL == pdc->connection)
return;
-
-
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Processing DONAU charity get response");
-
/* Anything but 200 => propagate Donau’s response. */
if (MHD_HTTP_OK != gcr->hr.http_status)
{
@@ -131,11 +131,10 @@ donau_charity_get_cb (void *cls,
return;
}
- enum GNUNET_DB_QueryStatus qs =
- TMH_db->insert_donau_instance (TMH_db->cls,
- pdc->donau_url,
- &pdc->charity,
- pdc->charity_id);
+ qs = TMH_db->insert_donau_instance (TMH_db->cls,
+ pdc->donau_url,
+ &pdc->charity,
+ pdc->charity_id);
switch (qs)
{
case GNUNET_DB_STATUS_HARD_ERROR:
@@ -207,6 +206,7 @@ TMH_private_post_donau_instance (const struct TMH_RequestHandler *rh,
struct MHD_Connection *connection,
struct TMH_HandlerContext *hc)
{
+ struct PostDonauCtx *pdc = hc->ctx;
const char *donau_url = NULL;
uint64_t charity_id = -1;
struct GNUNET_JSON_Specification spec[] = {
@@ -216,14 +216,16 @@ TMH_private_post_donau_instance (const struct TMH_RequestHandler *rh,
&charity_id),
GNUNET_JSON_spec_end ()
};
- if (GNUNET_OK != TALER_MHD_parse_json_data (connection,
- hc->request_body,
- spec))
+
+ if (GNUNET_OK !=
+ TALER_MHD_parse_json_data (connection,
+ hc->request_body,
+ spec))
{
return MHD_NO;
}
- if (NULL == donau_url
- || -1 == charity_id)
+ if ( (NULL == donau_url) ||
+ (-1 == charity_id) )
{
GNUNET_break (0);
return TALER_MHD_reply_with_error (connection,
@@ -232,7 +234,6 @@ TMH_private_post_donau_instance (const struct TMH_RequestHandler *rh,
"Missing donau_url or charity_id");
}
- struct PostDonauCtx *pdc = hc->ctx;
if (NULL == pdc)
{
pdc = GNUNET_new (struct PostDonauCtx);
@@ -256,13 +257,13 @@ TMH_private_post_donau_instance (const struct TMH_RequestHandler *rh,
if (NULL == pdc->get_handle)
{
+ GNUNET_break (0);
GNUNET_free (pdc);
return TALER_MHD_reply_with_error (connection,
MHD_HTTP_SERVICE_UNAVAILABLE,
TALER_EC_GENERIC_ALLOCATION_FAILURE,
"Failed to initiate Donau lookup");
}
-
MHD_suspend_connection (connection);
return MHD_YES;
}
diff --git a/src/backend/taler-merchant-httpd_private-post-instances.c b/src/backend/taler-merchant-httpd_private-post-instances.c
@@ -48,7 +48,7 @@
* instance can become fully active
* @return MHD result code
*/
-MHD_RESULT
+static MHD_RESULT
post_instances (const struct TMH_RequestHandler *rh,
struct MHD_Connection *connection,
struct TMH_HandlerContext *hc,