diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-02-14 14:28:54 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-02-14 14:28:54 +0000 |
commit | 9dda738084444ba8b01045cd65bdbfc305100e45 (patch) | |
tree | c0339d71d941563c86f0decf666b6c75ff077324 /src/transport/transport-testing.c | |
parent | eb80c6d8f1002ca39d17491ea8efd70bc7c137da (diff) | |
download | gnunet-9dda738084444ba8b01045cd65bdbfc305100e45.tar.gz gnunet-9dda738084444ba8b01045cd65bdbfc305100e45.zip |
- improved logging
Diffstat (limited to 'src/transport/transport-testing.c')
-rw-r--r-- | src/transport/transport-testing.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/src/transport/transport-testing.c b/src/transport/transport-testing.c index 01b313a15..3ef6e4b21 100644 --- a/src/transport/transport-testing.c +++ b/src/transport/transport-testing.c | |||
@@ -104,7 +104,6 @@ notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
104 | if (p->nc != NULL) | 104 | if (p->nc != NULL) |
105 | p->nc (p->cb_cls, peer, ats, ats_count); | 105 | p->nc (p->cb_cls, peer, ats, ats_count); |
106 | 106 | ||
107 | #if VERBOSE | ||
108 | char *p2_s; | 107 | char *p2_s; |
109 | 108 | ||
110 | if (p2 != NULL) | 109 | if (p2 != NULL) |
@@ -115,8 +114,6 @@ notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
115 | "Peers %s connected to peer %u (`%s')\n", p2_s, p->no, | 114 | "Peers %s connected to peer %u (`%s')\n", p2_s, p->no, |
116 | GNUNET_i2s (&p->id)); | 115 | GNUNET_i2s (&p->id)); |
117 | GNUNET_free (p2_s); | 116 | GNUNET_free (p2_s); |
118 | #endif | ||
119 | |||
120 | 117 | ||
121 | /* Find ConnectingContext */ | 118 | /* Find ConnectingContext */ |
122 | struct ConnectingContext *cc = find_connecting_context (p->tth, p, p2); | 119 | struct ConnectingContext *cc = find_connecting_context (p->tth, p, p2); |
@@ -192,26 +189,15 @@ get_hello (void *cb_cls, const struct GNUNET_MessageHeader *message) | |||
192 | GNUNET_assert (GNUNET_OK == | 189 | GNUNET_assert (GNUNET_OK == |
193 | GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message *) | 190 | GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message *) |
194 | message, &p->id)); | 191 | message, &p->id)); |
195 | #if VERBOSE | ||
196 | size_t size = | ||
197 | GNUNET_HELLO_size ((const struct GNUNET_HELLO_Message *) message); | ||
198 | #endif | ||
199 | GNUNET_free_non_null (p->hello); | 192 | GNUNET_free_non_null (p->hello); |
200 | p->hello = (struct GNUNET_HELLO_Message *) GNUNET_copy_message (message); | 193 | p->hello = (struct GNUNET_HELLO_Message *) GNUNET_copy_message (message); |
201 | 194 | ||
202 | #if VERBOSE | ||
203 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "transport-testing", | ||
204 | "New HELLO for peer %u (`%s') with size %u\n", p->no, | ||
205 | GNUNET_i2s (&p->id), size); | ||
206 | #endif | ||
207 | |||
208 | if (p->start_cb != NULL) | 195 | if (p->start_cb != NULL) |
209 | { | 196 | { |
210 | #if VERBOSE | ||
211 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "transport-testing", | 197 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "transport-testing", |
212 | "Peer %u (`%s') successfully started\n", p->no, | 198 | "Peer %u (`%s') successfully started\n", p->no, |
213 | GNUNET_i2s (&p->id)); | 199 | GNUNET_i2s (&p->id)); |
214 | #endif | 200 | |
215 | p->start_cb (p, p->cb_cls); | 201 | p->start_cb (p, p->cb_cls); |
216 | p->start_cb = NULL; | 202 | p->start_cb = NULL; |
217 | } | 203 | } |
@@ -347,7 +333,6 @@ GNUNET_TRANSPORT_TESTING_start_peer (struct GNUNET_TRANSPORT_TESTING_handle | |||
347 | GNUNET_assert (p->ghh != NULL); | 333 | GNUNET_assert (p->ghh != NULL); |
348 | 334 | ||
349 | GNUNET_CONTAINER_DLL_insert (tth->p_head, tth->p_tail, p); | 335 | GNUNET_CONTAINER_DLL_insert (tth->p_head, tth->p_tail, p); |
350 | |||
351 | return p; | 336 | return p; |
352 | } | 337 | } |
353 | 338 | ||
@@ -513,6 +498,10 @@ GNUNET_TRANSPORT_TESTING_stop_peer (struct GNUNET_TRANSPORT_TESTING_handle *tth, | |||
513 | 498 | ||
514 | GNUNET_CONTAINER_DLL_remove (tth->p_head, tth->p_tail, p); | 499 | GNUNET_CONTAINER_DLL_remove (tth->p_head, tth->p_tail, p); |
515 | 500 | ||
501 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "transport-testing", | ||
502 | "Peer %u (`%s') stopped \n", p->no, | ||
503 | GNUNET_i2s (&p->id)); | ||
504 | |||
516 | GNUNET_free (p); | 505 | GNUNET_free (p); |
517 | p = NULL; | 506 | p = NULL; |
518 | } | 507 | } |