[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] branch master updated: fix fakebank issue with timeouts
From: |
gnunet |
Subject: |
[taler-exchange] branch master updated: fix fakebank issue with timeouts in multi-threaded mode resulting in NPE |
Date: |
Thu, 09 Dec 2021 22:14:44 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
The following commit(s) were added to refs/heads/master by this push:
new 6dd4a90a fix fakebank issue with timeouts in multi-threaded mode
resulting in NPE
6dd4a90a is described below
commit 6dd4a90abdb3883108ae48f48ad73aa94dc64e24
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Thu Dec 9 22:14:42 2021 +0100
fix fakebank issue with timeouts in multi-threaded mode resulting in NPE
---
src/bank-lib/fakebank.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/src/bank-lib/fakebank.c b/src/bank-lib/fakebank.c
index e0d8e155..6549a288 100644
--- a/src/bank-lib/fakebank.c
+++ b/src/bank-lib/fakebank.c
@@ -480,11 +480,14 @@ lp_trigger (struct LongPoller *lp,
MHD_resume_connection (lp->conn);
GNUNET_free (lp);
h->mhd_again = true;
- if (NULL != h->mhd_task)
- GNUNET_SCHEDULER_cancel (h->mhd_task);
- h->mhd_task =
- GNUNET_SCHEDULER_add_now (&run_mhd,
- h);
+ if (-1 != h->lp_event)
+ {
+ if (NULL != h->mhd_task)
+ GNUNET_SCHEDULER_cancel (h->mhd_task);
+ h->mhd_task =
+ GNUNET_SCHEDULER_add_now (&run_mhd,
+ h);
+ }
}
@@ -2413,6 +2416,7 @@ schedule_httpd (struct TALER_FAKEBANK_Handle *h)
MHD_UNSIGNED_LONG_LONG timeout;
struct GNUNET_TIME_Relative tv;
+ GNUNET_assert (-1 != h->mhd_fd);
haveto = MHD_get_timeout (h->mhd_bank,
&timeout);
if (MHD_YES == haveto)
@@ -2450,6 +2454,7 @@ schedule_httpd (struct TALER_FAKEBANK_Handle *h)
MHD_UNSIGNED_LONG_LONG timeout;
struct GNUNET_TIME_Relative tv;
+ GNUNET_assert (-1 == h->lp_event);
FD_ZERO (&rs);
FD_ZERO (&ws);
FD_ZERO (&es);
@@ -2521,6 +2526,7 @@ run_mhd (void *cls)
h->mhd_again = false;
MHD_run (h->mhd_bank);
}
+ GNUNET_assert (-1 == h->lp_event);
schedule_httpd (h);
}
@@ -2554,6 +2560,7 @@ TALER_FAKEBANK_start2 (uint16_t port,
GNUNET_assert (strlen (currency) < TALER_CURRENCY_LEN);
h = GNUNET_new (struct TALER_FAKEBANK_Handle);
h->lp_event = -1;
+ h->mhd_fd = -1;
h->port = port;
h->ram_limit = ram_limit;
h->serial_counter = 0;
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-exchange] branch master updated: fix fakebank issue with timeouts in multi-threaded mode resulting in NPE,
gnunet <=