fix ftbfs issues in wire2

This commit is contained in:
Christian Grothoff 2020-12-09 13:06:31 +01:00
parent fa1914b267
commit 788f84f695
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -242,7 +242,7 @@ build_wire_state (void)
void void
TEH_wire_update_state () TEH_wire_update_state ()
{ {
__sync_fetch_and_add (&key_generation, __sync_fetch_and_add (&wire_generation,
1); 1);
} }
@ -262,7 +262,7 @@ get_wire_state (void)
old_wsh = pthread_getspecific (wire_state); old_wsh = pthread_getspecific (wire_state);
if ( (NULL == old_wsh) || if ( (NULL == old_wsh) ||
(old_wsh->key_generation < key_generation) ) (old_wsh->wire_generation < wire_generation) )
{ {
wsh = build_wire_state (); wsh = build_wire_state ();
if (NULL == wsh) if (NULL == wsh)
@ -275,8 +275,7 @@ get_wire_state (void)
return NULL; return NULL;
} }
if (NULL != old_wsh) if (NULL != old_wsh)
destroy_key_state (old_wsh, destroy_wire_state (old_wsh);
false);
return wsh; return wsh;
} }
return old_wsh; return old_wsh;
@ -302,9 +301,9 @@ TEH_handler_wire (const struct TEH_RequestHandler *rh,
(void) args; (void) args;
wsh = get_wire_state (); wsh = get_wire_state ();
if (NULL == wsh) if (NULL == wsh)
TALER_MHD_reply_error (connection, TALER_MHD_reply_with_error (connection,
MHD_HTTP_INTERNAL_SERVER_ERROR, MHD_HTTP_INTERNAL_SERVER_ERROR,
TALER_EC_WTF, TALER_EC_EXCHANGE_GENERIC_BAD_CONFIGURATION,
NULL); NULL);
return TALER_MHD_reply_json (connection, return TALER_MHD_reply_json (connection,
json_incref (wsh->wire_reply), json_incref (wsh->wire_reply),