diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-02-13 13:38:40 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-02-13 13:38:40 +0000 |
commit | 063290f834eba02149addf177ac13dc3c5b32894 (patch) | |
tree | 2cbb32f4e491d6e4712e26dc6905c5bb12e24be5 /src/core/test_core_api.c | |
parent | aebb866a90e9e59bb01cda646406a2ad26151895 (diff) | |
download | gnunet-063290f834eba02149addf177ac13dc3c5b32894.tar.gz gnunet-063290f834eba02149addf177ac13dc3c5b32894.zip |
fix test
Diffstat (limited to 'src/core/test_core_api.c')
-rw-r--r-- | src/core/test_core_api.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/core/test_core_api.c b/src/core/test_core_api.c index 72846ed0f..9f3aad016 100644 --- a/src/core/test_core_api.c +++ b/src/core/test_core_api.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | (C) 2009 Christian Grothoff (and other contributing authors) | 3 | (C) 2009, 2010 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -34,11 +34,10 @@ | |||
34 | #include "gnunet_scheduler_lib.h" | 34 | #include "gnunet_scheduler_lib.h" |
35 | #include "gnunet_transport_service.h" | 35 | #include "gnunet_transport_service.h" |
36 | 36 | ||
37 | #define VERBOSE GNUNET_NO | 37 | #define VERBOSE GNUNET_YES |
38 | 38 | ||
39 | #define START_ARM GNUNET_YES | 39 | #define START_ARM GNUNET_YES |
40 | 40 | ||
41 | |||
42 | /** | 41 | /** |
43 | * How long until we give up on transmitting the message? | 42 | * How long until we give up on transmitting the message? |
44 | */ | 43 | */ |
@@ -53,6 +52,7 @@ struct PeerContext | |||
53 | struct GNUNET_PeerIdentity id; | 52 | struct GNUNET_PeerIdentity id; |
54 | struct GNUNET_TRANSPORT_Handle *th; | 53 | struct GNUNET_TRANSPORT_Handle *th; |
55 | struct GNUNET_MessageHeader *hello; | 54 | struct GNUNET_MessageHeader *hello; |
55 | int connect_status; | ||
56 | #if START_ARM | 56 | #if START_ARM |
57 | pid_t arm_pid; | 57 | pid_t arm_pid; |
58 | #endif | 58 | #endif |
@@ -114,7 +114,9 @@ connect_notify (void *cls, | |||
114 | struct GNUNET_TIME_Relative latency, | 114 | struct GNUNET_TIME_Relative latency, |
115 | uint32_t distance) | 115 | uint32_t distance) |
116 | { | 116 | { |
117 | GNUNET_assert ((ok == 5) || (ok == 6)); | 117 | struct PeerContext *pc = cls; |
118 | GNUNET_assert (pc->connect_status == 0); | ||
119 | pc->connect_status = 1; | ||
118 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 120 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
119 | "Encrypted connection established to peer `%4s'\n", | 121 | "Encrypted connection established to peer `%4s'\n", |
120 | GNUNET_i2s (peer)); | 122 | GNUNET_i2s (peer)); |
@@ -125,6 +127,9 @@ static void | |||
125 | disconnect_notify (void *cls, | 127 | disconnect_notify (void *cls, |
126 | const struct GNUNET_PeerIdentity *peer) | 128 | const struct GNUNET_PeerIdentity *peer) |
127 | { | 129 | { |
130 | struct PeerContext *pc = cls; | ||
131 | GNUNET_assert (pc->connect_status == 1); | ||
132 | pc->connect_status = 0; | ||
128 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 133 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
129 | "Encrypted connection to `%4s' cut\n", GNUNET_i2s (peer)); | 134 | "Encrypted connection to `%4s' cut\n", GNUNET_i2s (peer)); |
130 | } | 135 | } |