diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-05-06 01:12:57 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-05-06 01:12:57 +0000 |
commit | 9fac6b6eefdc9144053f736fd388cb2199a97046 (patch) | |
tree | 82740a981b7f6ae973d915aa77797acd9db668b2 /src/core/gnunet-service-core_neighbours.c | |
parent | 23d8d343d5c70481ecf78ec4fafc698907f3e8a9 (diff) | |
download | gnunet-9fac6b6eefdc9144053f736fd388cb2199a97046.tar.gz gnunet-9fac6b6eefdc9144053f736fd388cb2199a97046.zip |
-removing legacy ifdefs, fixing log statements
Diffstat (limited to 'src/core/gnunet-service-core_neighbours.c')
-rw-r--r-- | src/core/gnunet-service-core_neighbours.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/src/core/gnunet-service-core_neighbours.c b/src/core/gnunet-service-core_neighbours.c index 538f38283..97737a63a 100644 --- a/src/core/gnunet-service-core_neighbours.c +++ b/src/core/gnunet-service-core_neighbours.c | |||
@@ -145,11 +145,9 @@ free_neighbour (struct Neighbour *n) | |||
145 | { | 145 | { |
146 | struct NeighbourMessageEntry *m; | 146 | struct NeighbourMessageEntry *m; |
147 | 147 | ||
148 | #if DEBUG_CORE | ||
149 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 148 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
150 | "Destroying neighbour entry for peer `%4s'\n", | 149 | "Destroying neighbour entry for peer `%4s'\n", |
151 | GNUNET_i2s (&n->peer)); | 150 | GNUNET_i2s (&n->peer)); |
152 | #endif | ||
153 | while (NULL != (m = n->message_head)) | 151 | while (NULL != (m = n->message_head)) |
154 | { | 152 | { |
155 | GNUNET_CONTAINER_DLL_remove (n->message_head, n->message_tail, m); | 153 | GNUNET_CONTAINER_DLL_remove (n->message_head, n->message_tail, m); |
@@ -224,13 +222,11 @@ transmit_ready (void *cls, size_t size, void *buf) | |||
224 | GNUNET_CONTAINER_DLL_remove (n->message_head, n->message_tail, m); | 222 | GNUNET_CONTAINER_DLL_remove (n->message_head, n->message_tail, m); |
225 | if (buf == NULL) | 223 | if (buf == NULL) |
226 | { | 224 | { |
227 | #if DEBUG_CORE | ||
228 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 225 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
229 | "Transmission of message of type %u and size %u failed\n", | 226 | "Transmission of message of type %u and size %u failed\n", |
230 | (unsigned int) | 227 | (unsigned int) |
231 | ntohs (((struct GNUNET_MessageHeader *) &m[1])->type), | 228 | ntohs (((struct GNUNET_MessageHeader *) &m[1])->type), |
232 | (unsigned int) m->size); | 229 | (unsigned int) m->size); |
233 | #endif | ||
234 | GNUNET_free (m); | 230 | GNUNET_free (m); |
235 | process_queue (n); | 231 | process_queue (n); |
236 | return 0; | 232 | return 0; |
@@ -239,13 +235,11 @@ transmit_ready (void *cls, size_t size, void *buf) | |||
239 | GNUNET_assert (size >= m->size); | 235 | GNUNET_assert (size >= m->size); |
240 | memcpy (cbuf, &m[1], m->size); | 236 | memcpy (cbuf, &m[1], m->size); |
241 | ret = m->size; | 237 | ret = m->size; |
242 | #if DEBUG_CORE | ||
243 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 238 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
244 | "Copied message of type %u and size %u into transport buffer for `%4s'\n", | 239 | "Copied message of type %u and size %u into transport buffer for `%4s'\n", |
245 | (unsigned int) | 240 | (unsigned int) |
246 | ntohs (((struct GNUNET_MessageHeader *) &m[1])->type), | 241 | ntohs (((struct GNUNET_MessageHeader *) &m[1])->type), |
247 | (unsigned int) ret, GNUNET_i2s (&n->peer)); | 242 | (unsigned int) ret, GNUNET_i2s (&n->peer)); |
248 | #endif | ||
249 | GNUNET_free (m); | 243 | GNUNET_free (m); |
250 | process_queue (n); | 244 | process_queue (n); |
251 | GNUNET_STATISTICS_update (GSC_stats, | 245 | GNUNET_STATISTICS_update (GSC_stats, |
@@ -277,13 +271,11 @@ process_queue (struct Neighbour *n) | |||
277 | GSC_SESSIONS_solicit (&n->peer); | 271 | GSC_SESSIONS_solicit (&n->peer); |
278 | return; | 272 | return; |
279 | } | 273 | } |
280 | #if DEBUG_CORE > 1 | ||
281 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 274 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
282 | "Asking transport for transmission of %u bytes to `%4s' in next %llu ms\n", | 275 | "Asking transport for transmission of %u bytes to `%4s' in next %llu ms\n", |
283 | (unsigned int) m->size, GNUNET_i2s (&n->peer), | 276 | (unsigned int) m->size, GNUNET_i2s (&n->peer), |
284 | (unsigned long long) | 277 | (unsigned long long) |
285 | GNUNET_TIME_absolute_get_remaining (m->deadline).rel_value); | 278 | GNUNET_TIME_absolute_get_remaining (m->deadline).rel_value); |
286 | #endif | ||
287 | n->th = | 279 | n->th = |
288 | GNUNET_TRANSPORT_notify_transmit_ready (transport, &n->peer, m->size, 0, | 280 | GNUNET_TRANSPORT_notify_transmit_ready (transport, &n->peer, m->size, 0, |
289 | GNUNET_TIME_absolute_get_remaining | 281 | GNUNET_TIME_absolute_get_remaining |
@@ -330,10 +322,8 @@ handle_transport_notify_connect (void *cls, | |||
330 | GNUNET_break (0); | 322 | GNUNET_break (0); |
331 | return; | 323 | return; |
332 | } | 324 | } |
333 | #if DEBUG_CORE | ||
334 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received connection from `%4s'.\n", | 325 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received connection from `%4s'.\n", |
335 | GNUNET_i2s (peer)); | 326 | GNUNET_i2s (peer)); |
336 | #endif | ||
337 | n = GNUNET_malloc (sizeof (struct Neighbour)); | 327 | n = GNUNET_malloc (sizeof (struct Neighbour)); |
338 | n->peer = *peer; | 328 | n->peer = *peer; |
339 | GNUNET_assert (GNUNET_OK == | 329 | GNUNET_assert (GNUNET_OK == |
@@ -361,11 +351,9 @@ handle_transport_notify_disconnect (void *cls, | |||
361 | { | 351 | { |
362 | struct Neighbour *n; | 352 | struct Neighbour *n; |
363 | 353 | ||
364 | #if DEBUG_CORE | ||
365 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 354 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
366 | "Peer `%4s' disconnected from us; received notification from transport.\n", | 355 | "Peer `%4s' disconnected from us; received notification from transport.\n", |
367 | GNUNET_i2s (peer)); | 356 | GNUNET_i2s (peer)); |
368 | #endif | ||
369 | n = find_neighbour (peer); | 357 | n = find_neighbour (peer); |
370 | if (n == NULL) | 358 | if (n == NULL) |
371 | { | 359 | { |
@@ -394,11 +382,9 @@ handle_transport_receive (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
394 | struct Neighbour *n; | 382 | struct Neighbour *n; |
395 | uint16_t type; | 383 | uint16_t type; |
396 | 384 | ||
397 | #if DEBUG_CORE > 1 | ||
398 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 385 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
399 | "Received message of type %u from `%4s', demultiplexing.\n", | 386 | "Received message of type %u from `%4s', demultiplexing.\n", |
400 | (unsigned int) ntohs (message->type), GNUNET_i2s (peer)); | 387 | (unsigned int) ntohs (message->type), GNUNET_i2s (peer)); |
401 | #endif | ||
402 | if (0 == memcmp (peer, &GSC_my_identity, sizeof (struct GNUNET_PeerIdentity))) | 388 | if (0 == memcmp (peer, &GSC_my_identity, sizeof (struct GNUNET_PeerIdentity))) |
403 | { | 389 | { |
404 | GNUNET_break (0); | 390 | GNUNET_break (0); |