From 1655c09ee78640747e2d49326e464855ae999d5b Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 27 Jun 2016 09:51:31 +0000 Subject: [PATCH] -fix queueing issue --- src/core/core_api.c | 13 +++++++++++-- src/core/test_core_api_data.conf | 1 - 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/core/core_api.c b/src/core/core_api.c index 451b871fb..4c55d0e5f 100644 --- a/src/core/core_api.c +++ b/src/core/core_api.c @@ -332,6 +332,9 @@ handle_mq_error (void *cls, { struct GNUNET_CORE_Handle *h = cls; + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "MQ ERROR: %d\n", + error); reconnect_later (h); } @@ -707,12 +710,13 @@ handle_send_ready (void *cls, sm->peer = pr->peer; sm->cork = htonl ((uint32_t) th->cork); sm->reserved = htonl (0); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Calling get_message with buffer of %u bytes\n", + (unsigned int) th->msize); ret = th->get_message (th->get_message_cls, th->msize, &sm[1]); sm->header.size = htons (ret + sizeof (struct SendMessage)); - th->msize = ret; - // GNUNET_assert (ret == th->msize); /* NOTE: API change! */ delay = GNUNET_TIME_absolute_get_duration (th->request_time); overdue = GNUNET_TIME_absolute_get_duration (th->deadline); if (overdue.rel_value_us > GNUNET_CONSTANTS_LATENCY_WARN.rel_value_us) @@ -887,6 +891,11 @@ GNUNET_CORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, LOG (GNUNET_ERROR_TYPE_DEBUG, "Connecting to CORE service\n"); reconnect (h); + if (NULL == h->mq) + { + GNUNET_CORE_disconnect (h); + return NULL; + } return h; } diff --git a/src/core/test_core_api_data.conf b/src/core/test_core_api_data.conf index a13cc8706..53f864bdd 100644 --- a/src/core/test_core_api_data.conf +++ b/src/core/test_core_api_data.conf @@ -8,4 +8,3 @@ WAN_QUOTA_OUT = 64 kiB [core] PORT = 2092 UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-core.sock - -- 2.25.1