aboutsummaryrefslogtreecommitdiff
path: root/src/core/test_core_quota_compliance.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-12-15 02:34:41 +0000
committerChristian Grothoff <christian@grothoff.org>2010-12-15 02:34:41 +0000
commit4bd7ac5418b648e1b46a8b718a817059ac5b280b (patch)
treedd0d6cf564cc14984c1b7a0c85daa7f112be98ba /src/core/test_core_quota_compliance.c
parent4cebadb72b620b901288dfaa49459aa3349cc5e1 (diff)
downloadgnunet-4bd7ac5418b648e1b46a8b718a817059ac5b280b.tar.gz
gnunet-4bd7ac5418b648e1b46a8b718a817059ac5b280b.zip
fix segv on shutdown
Diffstat (limited to 'src/core/test_core_quota_compliance.c')
-rw-r--r--src/core/test_core_quota_compliance.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/core/test_core_quota_compliance.c b/src/core/test_core_quota_compliance.c
index f5b5c0d92..7181564d8 100644
--- a/src/core/test_core_quota_compliance.c
+++ b/src/core/test_core_quota_compliance.c
@@ -20,9 +20,6 @@
20/** 20/**
21 * @file core/test_core_quota_compliance.c 21 * @file core/test_core_quota_compliance.c
22 * @brief testcase for core_api.c focusing quota compliance on core level 22 * @brief testcase for core_api.c focusing quota compliance on core level
23 *
24 * FIXME:
25 * - make sure connect callback is invoked properly as well!
26 */ 23 */
27#include "platform.h" 24#include "platform.h"
28#include "gnunet_common.h" 25#include "gnunet_common.h"
@@ -122,10 +119,14 @@ struct TestMessage
122static void 119static void
123terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 120terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
124{ 121{
125 GNUNET_CORE_disconnect (p1.ch); 122 struct GNUNET_CORE_Handle *ch;
123
124 ch = p1.ch;
126 p1.ch = NULL; 125 p1.ch = NULL;
127 GNUNET_CORE_disconnect (p2.ch); 126 GNUNET_CORE_disconnect (ch);
127 ch = p2.ch;
128 p2.ch = NULL; 128 p2.ch = NULL;
129 GNUNET_CORE_disconnect (ch);
129 GNUNET_TRANSPORT_disconnect (p1.th); 130 GNUNET_TRANSPORT_disconnect (p1.th);
130 p1.th = NULL; 131 p1.th = NULL;
131 GNUNET_TRANSPORT_disconnect (p2.th); 132 GNUNET_TRANSPORT_disconnect (p2.th);
@@ -314,7 +315,8 @@ transmit_ready (void *cls, size_t size, void *buf)
314 GNUNET_assert (size <= GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE); 315 GNUNET_assert (size <= GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE);
315 if (buf == NULL) 316 if (buf == NULL)
316 { 317 {
317 if (p1.ch != NULL) 318 if ( (p1.ch != NULL) &&
319 (p1.connect_status == 1) )
318 GNUNET_break (NULL != 320 GNUNET_break (NULL !=
319 GNUNET_CORE_notify_transmit_ready (p1.ch, 321 GNUNET_CORE_notify_transmit_ready (p1.ch,
320 0, 322 0,