aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-04-02 13:48:08 +0000
committerChristian Grothoff <christian@grothoff.org>2012-04-02 13:48:08 +0000
commit45cb6dbbdd3a509e54f94eff3b4f96ed3734b7c9 (patch)
tree0135934d33225151bec614237c40ae0a991cba25
parent8d69aeda86985616d001e8e18eb8d808edaf4fdb (diff)
downloadgnunet-45cb6dbbdd3a509e54f94eff3b4f96ed3734b7c9.tar.gz
gnunet-45cb6dbbdd3a509e54f94eff3b4f96ed3734b7c9.zip
-removing legacy ifdefs
-rw-r--r--src/peerinfo/gnunet-service-peerinfo.c8
-rw-r--r--src/peerinfo/peerinfo.h1
-rw-r--r--src/peerinfo/peerinfo_api.c17
-rw-r--r--src/peerinfo/peerinfo_api_notify.c2
4 files changed, 0 insertions, 28 deletions
diff --git a/src/peerinfo/gnunet-service-peerinfo.c b/src/peerinfo/gnunet-service-peerinfo.c
index 2a5921b5d..2dbdc9f83 100644
--- a/src/peerinfo/gnunet-service-peerinfo.c
+++ b/src/peerinfo/gnunet-service-peerinfo.c
@@ -534,10 +534,8 @@ handle_hello (void *cls, struct GNUNET_SERVER_Client *client,
534 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); 534 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
535 return; 535 return;
536 } 536 }
537#if DEBUG_PEERINFO
538 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' message received for peer `%4s'\n", 537 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' message received for peer `%4s'\n",
539 "HELLO", GNUNET_i2s (&pid)); 538 "HELLO", GNUNET_i2s (&pid));
540#endif
541 bind_address (&pid, hello); 539 bind_address (&pid, hello);
542 GNUNET_SERVER_receive_done (client, GNUNET_OK); 540 GNUNET_SERVER_receive_done (client, GNUNET_OK);
543} 541}
@@ -559,10 +557,8 @@ handle_get (void *cls, struct GNUNET_SERVER_Client *client,
559 557
560 lpm = (const struct ListPeerMessage *) message; 558 lpm = (const struct ListPeerMessage *) message;
561 GNUNET_break (0 == ntohl (lpm->reserved)); 559 GNUNET_break (0 == ntohl (lpm->reserved));
562#if DEBUG_PEERINFO
563 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' message received for peer `%4s'\n", 560 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' message received for peer `%4s'\n",
564 "GET", GNUNET_i2s (&lpm->peer)); 561 "GET", GNUNET_i2s (&lpm->peer));
565#endif
566 tc = GNUNET_SERVER_transmit_context_create (client); 562 tc = GNUNET_SERVER_transmit_context_create (client);
567 GNUNET_CONTAINER_multihashmap_get_multiple (hostmap, &lpm->peer.hashPubKey, 563 GNUNET_CONTAINER_multihashmap_get_multiple (hostmap, &lpm->peer.hashPubKey,
568 &add_to_tc, tc); 564 &add_to_tc, tc);
@@ -585,9 +581,7 @@ handle_get_all (void *cls, struct GNUNET_SERVER_Client *client,
585{ 581{
586 struct GNUNET_SERVER_TransmitContext *tc; 582 struct GNUNET_SERVER_TransmitContext *tc;
587 583
588#if DEBUG_PEERINFO
589 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' message received\n", "GET_ALL"); 584 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' message received\n", "GET_ALL");
590#endif
591 tc = GNUNET_SERVER_transmit_context_create (client); 585 tc = GNUNET_SERVER_transmit_context_create (client);
592 GNUNET_CONTAINER_multihashmap_iterate (hostmap, &add_to_tc, tc); 586 GNUNET_CONTAINER_multihashmap_iterate (hostmap, &add_to_tc, tc);
593 GNUNET_SERVER_transmit_context_append_data (tc, NULL, 0, 587 GNUNET_SERVER_transmit_context_append_data (tc, NULL, 0,
@@ -625,9 +619,7 @@ static void
625handle_notify (void *cls, struct GNUNET_SERVER_Client *client, 619handle_notify (void *cls, struct GNUNET_SERVER_Client *client,
626 const struct GNUNET_MessageHeader *message) 620 const struct GNUNET_MessageHeader *message)
627{ 621{
628#if DEBUG_PEERINFO
629 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' message received\n", "NOTIFY"); 622 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' message received\n", "NOTIFY");
630#endif
631 GNUNET_SERVER_notification_context_add (notify_list, client); 623 GNUNET_SERVER_notification_context_add (notify_list, client);
632 GNUNET_CONTAINER_multihashmap_iterate (hostmap, &do_notify_entry, client); 624 GNUNET_CONTAINER_multihashmap_iterate (hostmap, &do_notify_entry, client);
633 GNUNET_SERVER_receive_done (client, GNUNET_OK); 625 GNUNET_SERVER_receive_done (client, GNUNET_OK);
diff --git a/src/peerinfo/peerinfo.h b/src/peerinfo/peerinfo.h
index bf5677477..919645e17 100644
--- a/src/peerinfo/peerinfo.h
+++ b/src/peerinfo/peerinfo.h
@@ -27,7 +27,6 @@
27#include "gnunet_time_lib.h" 27#include "gnunet_time_lib.h"
28#include "gnunet_peerinfo_service.h" 28#include "gnunet_peerinfo_service.h"
29 29
30#define DEBUG_PEERINFO GNUNET_EXTRA_LOGGING
31 30
32GNUNET_NETWORK_STRUCT_BEGIN 31GNUNET_NETWORK_STRUCT_BEGIN
33 32
diff --git a/src/peerinfo/peerinfo_api.c b/src/peerinfo/peerinfo_api.c
index 124d55e42..fed577035 100644
--- a/src/peerinfo/peerinfo_api.c
+++ b/src/peerinfo/peerinfo_api.c
@@ -274,10 +274,8 @@ do_transmit (void *cls, size_t size, void *buf)
274 return 0; 274 return 0;
275 if (buf == NULL) 275 if (buf == NULL)
276 { 276 {
277#if DEBUG_PEERINFO
278 LOG (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK, 277 LOG (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK,
279 _("Failed to transmit message to `%s' service.\n"), "PEERINFO"); 278 _("Failed to transmit message to `%s' service.\n"), "PEERINFO");
280#endif
281 GNUNET_CONTAINER_DLL_remove (h->tq_head, h->tq_tail, tqe); 279 GNUNET_CONTAINER_DLL_remove (h->tq_head, h->tq_tail, tqe);
282 reconnect (h); 280 reconnect (h);
283 if (tqe->cont != NULL) 281 if (tqe->cont != NULL)
@@ -288,10 +286,8 @@ do_transmit (void *cls, size_t size, void *buf)
288 ret = tqe->size; 286 ret = tqe->size;
289 GNUNET_assert (size >= ret); 287 GNUNET_assert (size >= ret);
290 memcpy (buf, &tqe[1], ret); 288 memcpy (buf, &tqe[1], ret);
291#if DEBUG_PEERINFO
292 LOG (GNUNET_ERROR_TYPE_DEBUG, 289 LOG (GNUNET_ERROR_TYPE_DEBUG,
293 "Transmitting request of size %u to `%s' service.\n", ret, "PEERINFO"); 290 "Transmitting request of size %u to `%s' service.\n", ret, "PEERINFO");
294#endif
295 GNUNET_CONTAINER_DLL_remove (h->tq_head, h->tq_tail, tqe); 291 GNUNET_CONTAINER_DLL_remove (h->tq_head, h->tq_tail, tqe);
296 if (tqe->cont != NULL) 292 if (tqe->cont != NULL)
297 tqe->cont (tqe->cont_cls, GNUNET_OK); 293 tqe->cont (tqe->cont_cls, GNUNET_OK);
@@ -349,15 +345,12 @@ GNUNET_PEERINFO_add_peer (struct GNUNET_PEERINFO_Handle *h,
349{ 345{
350 uint16_t hs = GNUNET_HELLO_size (hello); 346 uint16_t hs = GNUNET_HELLO_size (hello);
351 struct TransmissionQueueEntry *tqe; 347 struct TransmissionQueueEntry *tqe;
352
353#if DEBUG_PEERINFO
354 struct GNUNET_PeerIdentity peer; 348 struct GNUNET_PeerIdentity peer;
355 349
356 GNUNET_assert (GNUNET_OK == GNUNET_HELLO_get_id (hello, &peer)); 350 GNUNET_assert (GNUNET_OK == GNUNET_HELLO_get_id (hello, &peer));
357 LOG (GNUNET_ERROR_TYPE_DEBUG, 351 LOG (GNUNET_ERROR_TYPE_DEBUG,
358 "Adding peer `%s' to PEERINFO database (%u bytes of `%s')\n", 352 "Adding peer `%s' to PEERINFO database (%u bytes of `%s')\n",
359 GNUNET_i2s (&peer), hs, "HELLO"); 353 GNUNET_i2s (&peer), hs, "HELLO");
360#endif
361 tqe = GNUNET_malloc (sizeof (struct TransmissionQueueEntry) + hs); 354 tqe = GNUNET_malloc (sizeof (struct TransmissionQueueEntry) + hs);
362 tqe->size = hs; 355 tqe->size = hs;
363 tqe->timeout = GNUNET_TIME_UNIT_FOREVER_ABS; 356 tqe->timeout = GNUNET_TIME_UNIT_FOREVER_ABS;
@@ -438,10 +431,8 @@ peerinfo_handler (void *cls, const struct GNUNET_MessageHeader *msg)
438 } 431 }
439 if (ntohs (msg->type) == GNUNET_MESSAGE_TYPE_PEERINFO_INFO_END) 432 if (ntohs (msg->type) == GNUNET_MESSAGE_TYPE_PEERINFO_INFO_END)
440 { 433 {
441#if DEBUG_PEERINFO
442 LOG (GNUNET_ERROR_TYPE_DEBUG, 434 LOG (GNUNET_ERROR_TYPE_DEBUG,
443 "Received end of list of peers from `%s' service\n", "PEERINFO"); 435 "Received end of list of peers from `%s' service\n", "PEERINFO");
444#endif
445 trigger_transmit (ic->h); 436 trigger_transmit (ic->h);
446 if (ic->timeout_task != GNUNET_SCHEDULER_NO_TASK) 437 if (ic->timeout_task != GNUNET_SCHEDULER_NO_TASK)
447 GNUNET_SCHEDULER_cancel (ic->timeout_task); 438 GNUNET_SCHEDULER_cancel (ic->timeout_task);
@@ -483,12 +474,10 @@ peerinfo_handler (void *cls, const struct GNUNET_MessageHeader *msg)
483 return; 474 return;
484 } 475 }
485 } 476 }
486#if DEBUG_PEERINFO
487 LOG (GNUNET_ERROR_TYPE_DEBUG, 477 LOG (GNUNET_ERROR_TYPE_DEBUG,
488 "Received %u bytes of `%s' information about peer `%s' from `%s' service\n", 478 "Received %u bytes of `%s' information about peer `%s' from `%s' service\n",
489 (hello == NULL) ? 0 : (unsigned int) GNUNET_HELLO_size (hello), "HELLO", 479 (hello == NULL) ? 0 : (unsigned int) GNUNET_HELLO_size (hello), "HELLO",
490 GNUNET_i2s (&im->peer), "PEERINFO"); 480 GNUNET_i2s (&im->peer), "PEERINFO");
491#endif
492 ic->h->in_receive = GNUNET_YES; 481 ic->h->in_receive = GNUNET_YES;
493 if (ic->callback != NULL) 482 if (ic->callback != NULL)
494 ic->callback (ic->callback_cls, &im->peer, hello, NULL); 483 ic->callback (ic->callback_cls, &im->peer, hello, NULL);
@@ -524,10 +513,8 @@ iterator_start_receive (void *cls, int transmit_success)
524 GNUNET_free (ic); 513 GNUNET_free (ic);
525 return; 514 return;
526 } 515 }
527#if DEBUG_PEERINFO
528 LOG (GNUNET_ERROR_TYPE_DEBUG, "Waiting for response from `%s' service.\n", 516 LOG (GNUNET_ERROR_TYPE_DEBUG, "Waiting for response from `%s' service.\n",
529 "PEERINFO"); 517 "PEERINFO");
530#endif
531 ic->h->in_receive = GNUNET_YES; 518 ic->h->in_receive = GNUNET_YES;
532 ic->in_receive = GNUNET_YES; 519 ic->in_receive = GNUNET_YES;
533 ic->tqe = NULL; 520 ic->tqe = NULL;
@@ -590,10 +577,8 @@ GNUNET_PEERINFO_iterate (struct GNUNET_PEERINFO_Handle *h,
590 577
591 if (peer == NULL) 578 if (peer == NULL)
592 { 579 {
593#if DEBUG_PEERINFO
594 LOG (GNUNET_ERROR_TYPE_DEBUG, 580 LOG (GNUNET_ERROR_TYPE_DEBUG,
595 "Requesting list of peers from PEERINFO service\n"); 581 "Requesting list of peers from PEERINFO service\n");
596#endif
597 tqe = 582 tqe =
598 GNUNET_malloc (sizeof (struct TransmissionQueueEntry) + 583 GNUNET_malloc (sizeof (struct TransmissionQueueEntry) +
599 sizeof (struct GNUNET_MessageHeader)); 584 sizeof (struct GNUNET_MessageHeader));
@@ -604,11 +589,9 @@ GNUNET_PEERINFO_iterate (struct GNUNET_PEERINFO_Handle *h,
604 } 589 }
605 else 590 else
606 { 591 {
607#if DEBUG_PEERINFO
608 LOG (GNUNET_ERROR_TYPE_DEBUG, 592 LOG (GNUNET_ERROR_TYPE_DEBUG,
609 "Requesting information on peer `%4s' from PEERINFO service\n", 593 "Requesting information on peer `%4s' from PEERINFO service\n",
610 GNUNET_i2s (peer)); 594 GNUNET_i2s (peer));
611#endif
612 tqe = 595 tqe =
613 GNUNET_malloc (sizeof (struct TransmissionQueueEntry) + 596 GNUNET_malloc (sizeof (struct TransmissionQueueEntry) +
614 sizeof (struct ListPeerMessage)); 597 sizeof (struct ListPeerMessage));
diff --git a/src/peerinfo/peerinfo_api_notify.c b/src/peerinfo/peerinfo_api_notify.c
index a0588db3d..2557cdfde 100644
--- a/src/peerinfo/peerinfo_api_notify.c
+++ b/src/peerinfo/peerinfo_api_notify.c
@@ -161,11 +161,9 @@ process_notification (void *cls, const struct GNUNET_MessageHeader *msg)
161 return; 161 return;
162 } 162 }
163 } 163 }
164#if DEBUG_PEERINFO
165 LOG (GNUNET_ERROR_TYPE_DEBUG, 164 LOG (GNUNET_ERROR_TYPE_DEBUG,
166 "Received information about peer `%s' from peerinfo database\n", 165 "Received information about peer `%s' from peerinfo database\n",
167 GNUNET_i2s (&im->peer)); 166 GNUNET_i2s (&im->peer));
168#endif
169 nc->callback (nc->callback_cls, &im->peer, hello, NULL); 167 nc->callback (nc->callback_cls, &im->peer, hello, NULL);
170 receive_notifications (nc); 168 receive_notifications (nc);
171} 169}