aboutsummaryrefslogtreecommitdiff
path: root/src/core/test_core_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-11-14 13:31:59 +0000
committerChristian Grothoff <christian@grothoff.org>2010-11-14 13:31:59 +0000
commitd1c3036fd48f2645fab427df4a47d3bc69410d15 (patch)
treebeb25728150a2acaf6e2f498f80ece1e47b3b66f /src/core/test_core_api.c
parent214424c6576d922dd5076ac5377294d81ccca647 (diff)
downloadgnunet-d1c3036fd48f2645fab427df4a47d3bc69410d15.tar.gz
gnunet-d1c3036fd48f2645fab427df4a47d3bc69410d15.zip
more checks
Diffstat (limited to 'src/core/test_core_api.c')
-rw-r--r--src/core/test_core_api.c35
1 files changed, 20 insertions, 15 deletions
diff --git a/src/core/test_core_api.c b/src/core/test_core_api.c
index 004486525..4a8546bbe 100644
--- a/src/core/test_core_api.c
+++ b/src/core/test_core_api.c
@@ -34,7 +34,7 @@
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
@@ -123,25 +123,29 @@ connect_notify (void *cls,
123 const struct GNUNET_TRANSPORT_ATS_Information *atsi) 123 const struct GNUNET_TRANSPORT_ATS_Information *atsi)
124{ 124{
125 struct PeerContext *pc = cls; 125 struct PeerContext *pc = cls;
126
126 GNUNET_assert (pc->connect_status == 0); 127 GNUNET_assert (pc->connect_status == 0);
127 pc->connect_status = 1; 128 pc->connect_status = 1;
128 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 129 if (pc == &p1)
129 "Encrypted connection established to peer `%4s'\n",
130 GNUNET_i2s (peer));
131 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
132 "Asking core (1) for transmission to peer `%4s'\n",
133 GNUNET_i2s (&p2.id));
134 if (NULL == GNUNET_CORE_notify_transmit_ready (p1.ch,
135 0,
136 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 45),
137 &p2.id,
138 sizeof (struct GNUNET_MessageHeader),
139 &transmit_ready, &p1))
140 { 130 {
141 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 131 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
142 "RECEIVED NULL when asking core (1) for transmission to peer `%4s'\n", 132 "Encrypted connection established to peer `%4s'\n",
133 GNUNET_i2s (peer));
134 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
135 "Asking core (1) for transmission to peer `%4s'\n",
143 GNUNET_i2s (&p2.id)); 136 GNUNET_i2s (&p2.id));
144 } 137 if (NULL == GNUNET_CORE_notify_transmit_ready (p1.ch,
138 0,
139 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 45),
140 &p2.id,
141 sizeof (struct GNUNET_MessageHeader),
142 &transmit_ready, &p1))
143 {
144 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
145 "RECEIVED NULL when asking core (1) for transmission to peer `%4s'\n",
146 GNUNET_i2s (&p2.id));
147 }
148 }
145} 149}
146 150
147 151
@@ -150,6 +154,7 @@ disconnect_notify (void *cls,
150 const struct GNUNET_PeerIdentity *peer) 154 const struct GNUNET_PeerIdentity *peer)
151{ 155{
152 struct PeerContext *pc = cls; 156 struct PeerContext *pc = cls;
157
153 pc->connect_status = 0; 158 pc->connect_status = 0;
154 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 159 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
155 "Encrypted connection to `%4s' cut\n", GNUNET_i2s (peer)); 160 "Encrypted connection to `%4s' cut\n", GNUNET_i2s (peer));