summaryrefslogtreecommitdiff
path: root/src/bank-lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/bank-lib')
-rw-r--r--src/bank-lib/fakebank.c15
-rw-r--r--src/bank-lib/taler-fakebank-run.c27
2 files changed, 34 insertions, 8 deletions
diff --git a/src/bank-lib/fakebank.c b/src/bank-lib/fakebank.c
index 6a6278ed..2a53419b 100644
--- a/src/bank-lib/fakebank.c
+++ b/src/bank-lib/fakebank.c
@@ -597,14 +597,9 @@ lookup_account (struct TALER_FAKEBANK_Handle *h,
0,
sizeof (hc));
slen = strlen (name);
- if (slen < sizeof (hc))
- memcpy (&hc,
- name,
- slen); /* fake hashing for speed! */
- else
- GNUNET_CRYPTO_hash (name,
- strlen (name),
- &hc);
+ GNUNET_CRYPTO_hash (name,
+ slen,
+ &hc);
GNUNET_assert (0 ==
pthread_mutex_lock (&h->accounts_lock));
account = GNUNET_CONTAINER_multihashmap_get (h->accounts,
@@ -2582,6 +2577,8 @@ TALER_FAKEBANK_start2 (uint16_t port,
&handle_mhd_completion_callback, h,
MHD_OPTION_LISTEN_BACKLOG_SIZE,
(unsigned int) 1024,
+ MHD_OPTION_CONNECTION_LIMIT,
+ (unsigned int) 65536,
MHD_OPTION_END);
if (NULL == h->mhd_bank)
{
@@ -2632,6 +2629,8 @@ TALER_FAKEBANK_start2 (uint16_t port,
&handle_mhd_completion_callback, h,
MHD_OPTION_LISTEN_BACKLOG_SIZE,
(unsigned int) 1024,
+ MHD_OPTION_CONNECTION_LIMIT,
+ (unsigned int) 65536,
MHD_OPTION_THREAD_POOL_SIZE,
num_threads,
MHD_OPTION_END);
diff --git a/src/bank-lib/taler-fakebank-run.c b/src/bank-lib/taler-fakebank-run.c
index 282e3950..7fa73046 100644
--- a/src/bank-lib/taler-fakebank-run.c
+++ b/src/bank-lib/taler-fakebank-run.c
@@ -47,6 +47,11 @@ static int ret;
*/
static struct TALER_FAKEBANK_Handle *fb;
+/**
+ * Keepalive task in multi-threaded mode.
+ */
+static struct GNUNET_SCHEDULER_Task *keepalive;
+
/**
* Stop the process.
@@ -59,6 +64,24 @@ do_shutdown (void *cls)
(void) cls;
TALER_FAKEBANK_stop (fb);
fb = NULL;
+ if (NULL != keepalive)
+ {
+ GNUNET_SCHEDULER_cancel (keepalive);
+ keepalive = NULL;
+ }
+}
+
+
+/**
+ * Task that should never be run.
+ *
+ * @param cls NULL
+ */
+static void
+keepalive_task (void *cls)
+{
+ (void) cls;
+ GNUNET_assert (0);
}
@@ -125,10 +148,14 @@ run (void *cls,
num_threads);
if (NULL == fb)
{
+ GNUNET_break (0);
ret = EXIT_FAILURE;
return;
}
GNUNET_free (currency_string);
+ keepalive = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
+ &keepalive_task,
+ NULL);
GNUNET_SCHEDULER_add_shutdown (&do_shutdown,
NULL);
ret = EXIT_SUCCESS;