This commit is contained in:
Marcello Stanisci 2019-02-13 17:53:48 +01:00
parent e1ec7fc53c
commit bb44b9b475
No known key found for this signature in database
GPG Key ID: 8D526861953F4C0F
5 changed files with 38 additions and 17 deletions

View File

@ -140,7 +140,8 @@ history_cb (void *cls,
void void
confirmation_cb (void *cls, confirmation_cb (void *cls,
int success, int success,
uint64_t serial_id, const void *row_id,
size_t row_id_size,
const char *emsg) const char *emsg)
{ {
if (GNUNET_YES != success) if (GNUNET_YES != success)

View File

@ -1647,7 +1647,8 @@ prepare_cb (void *cls,
static void static void
wire_confirm_cb (void *cls, wire_confirm_cb (void *cls,
int success, int success,
uint64_t serial_id, const void *row_id,
size_t row_id_size,
const char *emsg) const char *emsg)
{ {
struct TALER_EXCHANGEDB_Session *session = wpd->session; struct TALER_EXCHANGEDB_Session *session = wpd->session;

View File

@ -148,10 +148,10 @@ struct TALER_WIRE_HistoryHandle;
typedef void typedef void
(*TALER_WIRE_ConfirmationCallback)(void *cls, (*TALER_WIRE_ConfirmationCallback)(void *cls,
int success, int success,
uint64_t serial_id, const void *row_id,
size_t row_id_size,
const char *emsg); const char *emsg);
/** /**
* @brief The plugin API, returned from the plugin's "init" function. * @brief The plugin API, returned from the plugin's "init" function.
* The argument given to "init" is simply a configuration handle. * The argument given to "init" is simply a configuration handle.

View File

@ -632,6 +632,7 @@ execute_cb (void *cls,
json_t *reason; json_t *reason;
const char *emsg; const char *emsg;
char *s; char *s;
uint64_t serial_id_nbo;
eh->aaih = NULL; eh->aaih = NULL;
emsg = NULL; emsg = NULL;
@ -653,10 +654,15 @@ execute_cb (void *cls,
"%u/%u", "%u/%u",
http_status, http_status,
(unsigned int) ec); (unsigned int) ec);
serial_id_nbo = GNUNET_htonll (serial_id);
eh->cc (eh->cc_cls, eh->cc (eh->cc_cls,
(MHD_HTTP_OK == http_status) ? GNUNET_OK : GNUNET_SYSERR, (MHD_HTTP_OK == http_status) ? GNUNET_OK : GNUNET_SYSERR,
serial_id, &serial_id_nbo,
sizeof (uint64_t),
(MHD_HTTP_OK == http_status) ? NULL : s); (MHD_HTTP_OK == http_status) ? NULL : s);
GNUNET_free (s); GNUNET_free (s);
GNUNET_free (eh); GNUNET_free (eh);
} }

View File

@ -153,13 +153,16 @@ timeout_cb (void *cls)
* @param cls closure * @param cls closure
* @param ec taler status code * @param ec taler status code
* @param dir direction of the transfer * @param dir direction of the transfer
* @param row_off identification of the position at which we are querying * @param row_off identification of the position at
* which we are querying
* @param row_off_size number of bytes in @a row_off * @param row_off_size number of bytes in @a row_off
* @param details details about the wire transfer * @param details details about the wire transfer
* @return #GNUNET_OK to continue, #GNUNET_SYSERR to abort iteration * @return #GNUNET_OK to continue, #GNUNET_SYSERR to
* abort iteration
*/ */
static int static int
history_result_cb (void *cls, history_result_cb
(void *cls,
enum TALER_ErrorCode ec, enum TALER_ErrorCode ec,
enum TALER_BANK_Direction dir, enum TALER_BANK_Direction dir,
const void *row_off, const void *row_off,
@ -222,16 +225,20 @@ history_result_cb (void *cls,
* Function called with the result from the execute step. * Function called with the result from the execute step.
* *
* @param cls closure * @param cls closure
* @param success #GNUNET_OK on success, #GNUNET_SYSERR on failure * @param success #GNUNET_OK on success,
* @param serial_id unique ID of the wire transfer in the bank's records; UINT64_MAX on error * #GNUNET_SYSERR on failure
* @param row_id ID of the fresh transaction,
* in _network_ byte order.
* @param emsg NULL on success, otherwise an error message * @param emsg NULL on success, otherwise an error message
*/ */
static void static void
confirmation_cb (void *cls, confirmation_cb (void *cls,
int success, int success,
uint64_t serial_id, const void *row_id,
size_t row_id_size,
const char *emsg) const char *emsg)
{ {
uint64_t tmp;
eh = NULL; eh = NULL;
if (GNUNET_OK != success) if (GNUNET_OK != success)
{ {
@ -240,7 +247,13 @@ confirmation_cb (void *cls,
GNUNET_SCHEDULER_shutdown (); GNUNET_SCHEDULER_shutdown ();
return; return;
} }
serial_target = serial_id;
memcpy (&tmp,
row_id,
row_id_size);
serial_target = GNUNET_ntohll (tmp);
hh = plugin->get_history (plugin->cls, hh = plugin->get_history (plugin->cls,
my_account, my_account,
TALER_BANK_DIRECTION_BOTH, TALER_BANK_DIRECTION_BOTH,