aboutsummaryrefslogtreecommitdiff
path: root/src/bank-lib/fakebank.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-06-19 16:29:30 +0200
committerChristian Grothoff <christian@grothoff.org>2021-06-19 16:29:30 +0200
commitbbe86aee788df49b52601e264f517519a24841a8 (patch)
tree3d433c83fee76699a18c8f562d1cde6225231c57 /src/bank-lib/fakebank.c
parentad8390432b3d6a2d28b0465d41d3cce2bc941e4a (diff)
fix keepalive when using thread pool
Diffstat (limited to 'src/bank-lib/fakebank.c')
-rw-r--r--src/bank-lib/fakebank.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/bank-lib/fakebank.c b/src/bank-lib/fakebank.c
index 06470210b..0365a6510 100644
--- a/src/bank-lib/fakebank.c
+++ b/src/bank-lib/fakebank.c
@@ -24,6 +24,7 @@
// TODO: support long polling
// TODO: support adding WAD transfers
// TODO: adapt taler-exchange-benchmark to profile bank API
+// FIXME: support 'close_connections' option
#include "platform.h"
#include <pthread.h>
@@ -945,7 +946,11 @@ TALER_FAKEBANK_stop (struct TALER_FAKEBANK_Handle *h)
h->mhd_task = NULL;
}
#if EPOLL_SUPPORT
- GNUNET_NETWORK_socket_free_memory_only_ (h->mhd_rfd);
+ if (NULL != h->mhd_rfd)
+ {
+ GNUNET_NETWORK_socket_free_memory_only_ (h->mhd_rfd);
+ h->mhd_rfd = NULL;
+ }
#endif
if (NULL != h->mhd_bank)
{
@@ -1890,7 +1895,7 @@ TALER_FAKEBANK_start (uint16_t port,
return TALER_FAKEBANK_start2 (port,
currency,
65536, /* RAM limit */
- 0,
+ 1, /* number of threads */
false);
}
@@ -1972,7 +1977,8 @@ TALER_FAKEBANK_start2 (uint16_t port,
#if EPOLL_SUPPORT
| MHD_USE_EPOLL
#endif
- | MHD_USE_DUAL_STACK,
+ | MHD_USE_DUAL_STACK
+ | MHD_ALLOW_SUSPEND_RESUME,
port,
NULL, NULL,
&handle_mhd_request, h,