-code cleanup

This commit is contained in:
Christian Grothoff 2022-03-19 08:34:58 +01:00
parent 280f94c3a6
commit 52a8b8f888
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -286,6 +286,8 @@ version_completed_cb (void *cls,
"Received version from URL `%s' with status %ld.\n", "Received version from URL `%s' with status %ld.\n",
vr->url, vr->url,
response_code); response_code);
free_version_request (vr);
auditor->vr = NULL;
vc = TALER_AUDITOR_VC_PROTOCOL_ERROR; vc = TALER_AUDITOR_VC_PROTOCOL_ERROR;
switch (response_code) switch (response_code)
{ {
@ -293,8 +295,6 @@ version_completed_cb (void *cls,
case MHD_HTTP_INTERNAL_SERVER_ERROR: case MHD_HTTP_INTERNAL_SERVER_ERROR:
/* NOTE: this design is debatable. We MAY want to throw this error at the /* NOTE: this design is debatable. We MAY want to throw this error at the
client. We may then still additionally internally re-try. */ client. We may then still additionally internally re-try. */
free_version_request (vr);
auditor->vr = NULL;
GNUNET_assert (NULL == auditor->retry_task); GNUNET_assert (NULL == auditor->retry_task);
auditor->retry_delay = EXCHANGE_LIB_BACKOFF (auditor->retry_delay); auditor->retry_delay = EXCHANGE_LIB_BACKOFF (auditor->retry_delay);
auditor->retry_task = GNUNET_SCHEDULER_add_delayed (auditor->retry_delay, auditor->retry_task = GNUNET_SCHEDULER_add_delayed (auditor->retry_delay,
@ -333,11 +333,9 @@ version_completed_cb (void *cls,
if (MHD_HTTP_OK != response_code) if (MHD_HTTP_OK != response_code)
{ {
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"/version failed for auditor %p: %u!\n", "/version failed for auditor %s: %u!\n",
auditor, auditor->url,
(unsigned int) response_code); (unsigned int) response_code);
auditor->vr = NULL;
free_version_request (vr);
auditor->state = MHS_FAILED; auditor->state = MHS_FAILED;
/* notify application that we failed */ /* notify application that we failed */
auditor->version_cb (auditor->version_cb_cls, auditor->version_cb (auditor->version_cb_cls,
@ -346,14 +344,11 @@ version_completed_cb (void *cls,
vc); vc);
return; return;
} }
auditor->vr = NULL;
free_version_request (vr);
TALER_LOG_DEBUG ("Switching auditor state to 'version'\n"); TALER_LOG_DEBUG ("Switching auditor state to 'version'\n");
auditor->state = MHS_VERSION; auditor->state = MHS_VERSION;
GNUNET_log (GNUNET_ERROR_TYPE_INFO, GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Auditor %p is now READY!\n", "Auditor %s is now READY!\n",
auditor); auditor->url);
/* notify application about the key information */ /* notify application about the key information */
auditor->version_cb (auditor->version_cb_cls, auditor->version_cb (auditor->version_cb_cls,
&hr, &hr,