aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/arm/arm_api.c6
-rw-r--r--src/ats/ats_api.c28
-rw-r--r--src/ats/ats_api_peer_change_preference.c2
-rw-r--r--src/core/gnunet-service-core_clients.c6
-rw-r--r--src/core/gnunet-service-core_neighbours.c14
-rw-r--r--src/core/gnunet-service-core_sessions.c8
-rw-r--r--src/datacache/datacache.c9
-rw-r--r--src/datacache/plugin_datacache_mysql.c1
-rw-r--r--src/datacache/plugin_datacache_postgres.c44
-rw-r--r--src/datacache/plugin_datacache_sqlite.c20
-rw-r--r--src/datastore/datastore.h1
-rw-r--r--src/datastore/gnunet-service-datastore.c52
-rw-r--r--src/dht/gnunet-service-dht_datacache.c2
-rw-r--r--src/dns/dns.h4
-rw-r--r--src/dns/gnunet-service-dns.c4
-rw-r--r--src/fs/test_fs.c6
-rw-r--r--src/nat/gnunet-nat-server.c10
-rw-r--r--src/nat/nat.c12
-rw-r--r--src/nat/nat.h1
-rw-r--r--src/nat/nat_mini.c4
-rw-r--r--src/nat/nat_test.c14
-rw-r--r--src/nse/gnunet-service-nse.c18
-rw-r--r--src/nse/nse_api.c8
-rw-r--r--src/nse/test_nse_api.c11
-rwxr-xr-xsrc/peerinfo/perf_peerinfo_api.c29
-rw-r--r--src/peerinfo/test_peerinfo_api.c10
-rw-r--r--src/statistics/test_statistics_api.c15
-rw-r--r--src/transport/gnunet-service-transport.c14
-rw-r--r--src/transport/gnunet-service-transport_hello.c14
-rw-r--r--src/transport/gnunet-service-transport_neighbours.c66
-rw-r--r--src/transport/gnunet-service-transport_validation.c8
-rw-r--r--src/transport/plugin_transport_http.c20
-rw-r--r--src/transport/plugin_transport_http_server.c9
-rw-r--r--src/transport/plugin_transport_udp_broadcasting.c14
-rw-r--r--src/transport/transport.h5
-rw-r--r--src/transport/transport_api.c52
-rw-r--r--src/util/container_heap.c14
-rw-r--r--src/util/gnunet-service-resolver.c8
-rw-r--r--src/util/resolver.h2
-rw-r--r--src/util/resolver_api.c26
-rw-r--r--src/util/test_configuration.c7
41 files changed, 49 insertions, 549 deletions
diff --git a/src/arm/arm_api.c b/src/arm/arm_api.c
index d6b65e872..1b78d3393 100644
--- a/src/arm/arm_api.c
+++ b/src/arm/arm_api.c
@@ -383,9 +383,6 @@ arm_service_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
383 /* we're clearly running a test, don't daemonize */ 383 /* we're clearly running a test, don't daemonize */
384 proc = do_start_process (GNUNET_NO, 384 proc = do_start_process (GNUNET_NO,
385 NULL, loprefix, binary, "-c", config, 385 NULL, loprefix, binary, "-c", config,
386#if DEBUG_ARM
387 "-L", "DEBUG",
388#endif
389 /* no daemonization! */ 386 /* no daemonization! */
390 lopostfix, NULL); 387 lopostfix, NULL);
391 } 388 }
@@ -393,9 +390,6 @@ arm_service_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
393 { 390 {
394 proc = do_start_process (GNUNET_NO, 391 proc = do_start_process (GNUNET_NO,
395 NULL, loprefix, binary, "-c", config, 392 NULL, loprefix, binary, "-c", config,
396#if DEBUG_ARM
397 "-L", "DEBUG",
398#endif
399 "-d", lopostfix, NULL); 393 "-d", lopostfix, NULL);
400 } 394 }
401 GNUNET_free (binary); 395 GNUNET_free (binary);
diff --git a/src/ats/ats_api.c b/src/ats/ats_api.c
index 82eede9dc..8499c5b22 100644
--- a/src/ats/ats_api.c
+++ b/src/ats/ats_api.c
@@ -34,8 +34,6 @@
34#include "gnunet_ats_service.h" 34#include "gnunet_ats_service.h"
35#include "ats_api.h" 35#include "ats_api.h"
36 36
37#define DEBUG_ATS GNUNET_EXTRA_LOGGING
38
39#define LOG(kind,...) GNUNET_log_from (kind, "ats-api", __VA_ARGS__) 37#define LOG(kind,...) GNUNET_log_from (kind, "ats-api", __VA_ARGS__)
40 38
41/** 39/**
@@ -235,13 +233,10 @@ suggest_address (void *cls, const GNUNET_HashCode * key, void *value)
235 struct GNUNET_ATS_SuggestionContext *asc = cls; 233 struct GNUNET_ATS_SuggestionContext *asc = cls;
236 struct AllocationRecord *ar = value; 234 struct AllocationRecord *ar = value;
237 235
238#if DEBUG_ATS
239 LOG (GNUNET_ERROR_TYPE_DEBUG, 236 LOG (GNUNET_ERROR_TYPE_DEBUG,
240 "Suggesting address for peer `%s', starting with i:%u/o:%u bytes/s\n", 237 "Suggesting address for peer `%s', starting with i:%u/o:%u bytes/s\n",
241 GNUNET_h2s (key), asc->atc->total_bps_in / 32, 238 GNUNET_h2s (key), asc->atc->total_bps_in / 32,
242 asc->atc->total_bps_out / 32); 239 asc->atc->total_bps_out / 32);
243#endif
244
245 /* trivial strategy: pick first available address... */ 240 /* trivial strategy: pick first available address... */
246 asc->cb (asc->cb_cls, &asc->target, ar->plugin_name, ar->plugin_addr, 241 asc->cb (asc->cb_cls, &asc->target, ar->plugin_name, ar->plugin_addr,
247 ar->plugin_addr_len, ar->session, 242 ar->plugin_addr_len, ar->session,
@@ -269,10 +264,8 @@ GNUNET_ATS_suggest_address (struct GNUNET_ATS_SchedulingHandle *atc,
269{ 264{
270 struct GNUNET_ATS_SuggestionContext *asc; 265 struct GNUNET_ATS_SuggestionContext *asc;
271 266
272#if DEBUG_ATS
273 LOG (GNUNET_ERROR_TYPE_DEBUG, "Looking up suggested address for peer `%s'\n", 267 LOG (GNUNET_ERROR_TYPE_DEBUG, "Looking up suggested address for peer `%s'\n",
274 GNUNET_i2s (peer)); 268 GNUNET_i2s (peer));
275#endif
276 asc = GNUNET_malloc (sizeof (struct GNUNET_ATS_SuggestionContext)); 269 asc = GNUNET_malloc (sizeof (struct GNUNET_ATS_SuggestionContext));
277 asc->cb = cb; 270 asc->cb = cb;
278 asc->cb_cls = cb_cls; 271 asc->cb_cls = cb_cls;
@@ -324,9 +317,7 @@ GNUNET_ATS_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
324{ 317{
325 struct GNUNET_ATS_SchedulingHandle *atc; 318 struct GNUNET_ATS_SchedulingHandle *atc;
326 319
327#if DEBUG_ATS
328 LOG (GNUNET_ERROR_TYPE_DEBUG, "ATS init\n"); 320 LOG (GNUNET_ERROR_TYPE_DEBUG, "ATS init\n");
329#endif
330 atc = GNUNET_malloc (sizeof (struct GNUNET_ATS_SchedulingHandle)); 321 atc = GNUNET_malloc (sizeof (struct GNUNET_ATS_SchedulingHandle));
331 atc->cfg = cfg; 322 atc->cfg = cfg;
332 atc->alloc_cb = alloc_cb; 323 atc->alloc_cb = alloc_cb;
@@ -369,9 +360,7 @@ destroy_allocation_record (void *cls, const GNUNET_HashCode * key, void *value)
369void 360void
370GNUNET_ATS_shutdown (struct GNUNET_ATS_SchedulingHandle *atc) 361GNUNET_ATS_shutdown (struct GNUNET_ATS_SchedulingHandle *atc)
371{ 362{
372#if DEBUG_ATS
373 LOG (GNUNET_ERROR_TYPE_DEBUG, "ATS shutdown\n"); 363 LOG (GNUNET_ERROR_TYPE_DEBUG, "ATS shutdown\n");
374#endif
375 if (GNUNET_SCHEDULER_NO_TASK != atc->ba_task) 364 if (GNUNET_SCHEDULER_NO_TASK != atc->ba_task)
376 { 365 {
377 GNUNET_SCHEDULER_cancel (atc->ba_task); 366 GNUNET_SCHEDULER_cancel (atc->ba_task);
@@ -435,10 +424,8 @@ update_session (void *cls, const GNUNET_HashCode * key, void *value)
435 arnew->plugin_addr_len))))) 424 arnew->plugin_addr_len)))))
436 return GNUNET_YES; /* no match */ 425 return GNUNET_YES; /* no match */
437 /* records match */ 426 /* records match */
438#if DEBUG_ATS
439 LOG (GNUNET_ERROR_TYPE_DEBUG, "Updating session for peer `%s' plugin `%s'\n", 427 LOG (GNUNET_ERROR_TYPE_DEBUG, "Updating session for peer `%s' plugin `%s'\n",
440 GNUNET_h2s (key), arold->plugin_name); 428 GNUNET_h2s (key), arold->plugin_name);
441#endif
442 if (arnew->session != arold->session) 429 if (arnew->session != arold->session)
443 { 430 {
444 arold->session = arnew->session; 431 arold->session = arnew->session;
@@ -458,12 +445,10 @@ update_session (void *cls, const GNUNET_HashCode * key, void *value)
458 { 445 {
459 if (arold->ats[c_old].type == arnew->ats[c_new].type) 446 if (arold->ats[c_old].type == arnew->ats[c_new].type)
460 { 447 {
461#if DEBUG_ATS
462 LOG (GNUNET_ERROR_TYPE_DEBUG, 448 LOG (GNUNET_ERROR_TYPE_DEBUG,
463 "Found type %i, old value=%i new value=%i\n", 449 "Found type %i, old value=%i new value=%i\n",
464 ntohl (arold->ats[c_old].type), ntohl (arold->ats[c_old].value), 450 ntohl (arold->ats[c_old].type), ntohl (arold->ats[c_old].value),
465 ntohl (arnew->ats[c_new].value)); 451 ntohl (arnew->ats[c_new].value));
466#endif
467 arold->ats[c_old].value = arnew->ats[c_new].value; 452 arold->ats[c_old].value = arnew->ats[c_new].value;
468 found = GNUNET_YES; 453 found = GNUNET_YES;
469 } 454 }
@@ -472,20 +457,16 @@ update_session (void *cls, const GNUNET_HashCode * key, void *value)
472 /* Add new value */ 457 /* Add new value */
473 if (found == GNUNET_NO) 458 if (found == GNUNET_NO)
474 { 459 {
475#if DEBUG_ATS
476 LOG (GNUNET_ERROR_TYPE_DEBUG, "Added new type %i new value=%i\n", 460 LOG (GNUNET_ERROR_TYPE_DEBUG, "Added new type %i new value=%i\n",
477 ntohl (arnew->ats[c_new].type), ntohl (arnew->ats[c_new].value)); 461 ntohl (arnew->ats[c_new].type), ntohl (arnew->ats[c_new].value));
478 LOG (GNUNET_ERROR_TYPE_DEBUG, "Old array size: %u\n", arold->ats_count); 462 LOG (GNUNET_ERROR_TYPE_DEBUG, "Old array size: %u\n", arold->ats_count);
479#endif
480 GNUNET_array_grow (arold->ats, arold->ats_count, arold->ats_count + 1); 463 GNUNET_array_grow (arold->ats, arold->ats_count, arold->ats_count + 1);
481 GNUNET_assert (arold->ats_count >= 2); 464 GNUNET_assert (arold->ats_count >= 2);
482 arold->ats[arold->ats_count - 2].type = arnew->ats[c_new].type; 465 arold->ats[arold->ats_count - 2].type = arnew->ats[c_new].type;
483 arold->ats[arold->ats_count - 2].value = arnew->ats[c_new].value; 466 arold->ats[arold->ats_count - 2].value = arnew->ats[c_new].value;
484 arold->ats[arold->ats_count - 1].type = htonl (0); 467 arold->ats[arold->ats_count - 1].type = htonl (0);
485 arold->ats[arold->ats_count - 1].value = htonl (0); 468 arold->ats[arold->ats_count - 1].value = htonl (0);
486#if DEBUG_ATS
487 LOG (GNUNET_ERROR_TYPE_DEBUG, "New array size: %i\n", arold->ats_count); 469 LOG (GNUNET_ERROR_TYPE_DEBUG, "New array size: %i\n", arold->ats_count);
488#endif
489 } 470 }
490 c_new++; 471 c_new++;
491 } 472 }
@@ -577,10 +558,7 @@ GNUNET_ATS_peer_connect (struct GNUNET_ATS_SchedulingHandle *atc,
577 struct AllocationRecord *ar; 558 struct AllocationRecord *ar;
578 struct UpdateSessionContext usc; 559 struct UpdateSessionContext usc;
579 560
580#if DEBUG_ATS
581 LOG (GNUNET_ERROR_TYPE_DEBUG, "Connected to peer %s\n", GNUNET_i2s (peer)); 561 LOG (GNUNET_ERROR_TYPE_DEBUG, "Connected to peer %s\n", GNUNET_i2s (peer));
582#endif
583
584 (void) GNUNET_CONTAINER_multihashmap_iterate (atc->peers, &disconnect_peer, 562 (void) GNUNET_CONTAINER_multihashmap_iterate (atc->peers, &disconnect_peer,
585 atc); 563 atc);
586 ar = create_allocation_record (plugin_name, session, plugin_addr, 564 ar = create_allocation_record (plugin_name, session, plugin_addr,
@@ -613,10 +591,8 @@ void
613GNUNET_ATS_peer_disconnect (struct GNUNET_ATS_SchedulingHandle *atc, 591GNUNET_ATS_peer_disconnect (struct GNUNET_ATS_SchedulingHandle *atc,
614 const struct GNUNET_PeerIdentity *peer) 592 const struct GNUNET_PeerIdentity *peer)
615{ 593{
616#if DEBUG_ATS
617 LOG (GNUNET_ERROR_TYPE_DEBUG, "Disconnected from peer %s\n", 594 LOG (GNUNET_ERROR_TYPE_DEBUG, "Disconnected from peer %s\n",
618 GNUNET_i2s (peer)); 595 GNUNET_i2s (peer));
619#endif
620 (void) GNUNET_CONTAINER_multihashmap_get_multiple (atc->peers, 596 (void) GNUNET_CONTAINER_multihashmap_get_multiple (atc->peers,
621 &peer->hashPubKey, 597 &peer->hashPubKey,
622 &disconnect_peer, atc); 598 &disconnect_peer, atc);
@@ -748,10 +724,8 @@ GNUNET_ATS_address_update (struct GNUNET_ATS_SchedulingHandle *atc,
748 struct AllocationRecord *ar; 724 struct AllocationRecord *ar;
749 struct UpdateSessionContext usc; 725 struct UpdateSessionContext usc;
750 726
751#if DEBUG_ATS
752 LOG (GNUNET_ERROR_TYPE_DEBUG, "Updating address for peer `%s', plugin `%s'\n", 727 LOG (GNUNET_ERROR_TYPE_DEBUG, "Updating address for peer `%s', plugin `%s'\n",
753 GNUNET_i2s (peer), plugin_name); 728 GNUNET_i2s (peer), plugin_name);
754#endif
755 ar = create_allocation_record (plugin_name, session, plugin_addr, 729 ar = create_allocation_record (plugin_name, session, plugin_addr,
756 plugin_addr_len, ats, ats_count); 730 plugin_addr_len, ats, ats_count);
757 usc.atc = atc; 731 usc.atc = atc;
@@ -762,11 +736,9 @@ GNUNET_ATS_address_update (struct GNUNET_ATS_SchedulingHandle *atc,
762 destroy_allocation_record (NULL, &peer->hashPubKey, ar); 736 destroy_allocation_record (NULL, &peer->hashPubKey, ar);
763 return; 737 return;
764 } 738 }
765#if DEBUG_ATS
766 LOG (GNUNET_ERROR_TYPE_DEBUG, 739 LOG (GNUNET_ERROR_TYPE_DEBUG,
767 "Adding new address for peer `%s', plugin `%s'\n", GNUNET_i2s (peer), 740 "Adding new address for peer `%s', plugin `%s'\n", GNUNET_i2s (peer),
768 plugin_name); 741 plugin_name);
769#endif
770 ar->connected = GNUNET_NO; 742 ar->connected = GNUNET_NO;
771 GNUNET_assert (GNUNET_OK == 743 GNUNET_assert (GNUNET_OK ==
772 GNUNET_CONTAINER_multihashmap_put (atc->peers, 744 GNUNET_CONTAINER_multihashmap_put (atc->peers,
diff --git a/src/ats/ats_api_peer_change_preference.c b/src/ats/ats_api_peer_change_preference.c
index 7290ebb7a..bff9306e4 100644
--- a/src/ats/ats_api_peer_change_preference.c
+++ b/src/ats/ats_api_peer_change_preference.c
@@ -251,11 +251,9 @@ GNUNET_ATS_peer_change_preference (struct GNUNET_ATS_SchedulingHandle *h,
251 rim->reserve_inbound = htonl (amount); 251 rim->reserve_inbound = htonl (amount);
252 rim->preference_change = GNUNET_htonll (preference); 252 rim->preference_change = GNUNET_htonll (preference);
253 rim->peer = *peer; 253 rim->peer = *peer;
254#if DEBUG_ATS
255 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 254 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
256 "Queueing CHANGE PREFERENCE request for peer `%s' with RIM %u\n", 255 "Queueing CHANGE PREFERENCE request for peer `%s' with RIM %u\n",
257 GNUNET_i2s (peer), (unsigned int) pr->rim_id); 256 GNUNET_i2s (peer), (unsigned int) pr->rim_id);
258#endif
259 GNUNET_CONTAINER_DLL_insert_tail (h->control_pending_head, 257 GNUNET_CONTAINER_DLL_insert_tail (h->control_pending_head,
260 h->control_pending_tail, cm); 258 h->control_pending_tail, cm);
261 pr->pcic = info; 259 pr->pcic = info;
diff --git a/src/core/gnunet-service-core_clients.c b/src/core/gnunet-service-core_clients.c
index c8e1199b7..2c603d217 100644
--- a/src/core/gnunet-service-core_clients.c
+++ b/src/core/gnunet-service-core_clients.c
@@ -535,11 +535,9 @@ client_tokenizer_callback (void *cls, void *client,
535 } 535 }
536 else 536 else
537 { 537 {
538#if DEBUG_CORE
539 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 538 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
540 "Delivering message of type %u to %s\n", ntohs (message->type), 539 "Delivering message of type %u to %s\n", ntohs (message->type),
541 GNUNET_i2s (&car->target)); 540 GNUNET_i2s (&car->target));
542#endif
543 GSC_CLIENTS_deliver_message (&car->target, NULL, 0, message, 541 GSC_CLIENTS_deliver_message (&car->target, NULL, 0, message,
544 ntohs (message->size), 542 ntohs (message->size),
545 GNUNET_CORE_OPTION_SEND_FULL_OUTBOUND); 543 GNUNET_CORE_OPTION_SEND_FULL_OUTBOUND);
@@ -589,10 +587,8 @@ handle_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client)
589 587
590 if (client == NULL) 588 if (client == NULL)
591 return; 589 return;
592#if DEBUG_CORE
593 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 590 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
594 "Client %p has disconnected from core service.\n", client); 591 "Client %p has disconnected from core service.\n", client);
595#endif
596 c = find_client (client); 592 c = find_client (client);
597 if (c == NULL) 593 if (c == NULL)
598 return; /* client never sent INIT */ 594 return; /* client never sent INIT */
@@ -736,10 +732,8 @@ GSC_CLIENTS_notify_client_about_neighbour (struct GSC_Client *client,
736 cnm->ats_count = htonl (atsi_count); 732 cnm->ats_count = htonl (atsi_count);
737 a = (struct GNUNET_ATS_Information *) &cnm[1]; 733 a = (struct GNUNET_ATS_Information *) &cnm[1];
738 memcpy (a, atsi, sizeof (struct GNUNET_ATS_Information) * atsi_count); 734 memcpy (a, atsi, sizeof (struct GNUNET_ATS_Information) * atsi_count);
739#if DEBUG_CORE
740 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending `%s' message to client.\n", 735 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending `%s' message to client.\n",
741 "NOTIFY_CONNECT"); 736 "NOTIFY_CONNECT");
742#endif
743 cnm->peer = *neighbour; 737 cnm->peer = *neighbour;
744 send_to_client (client, &cnm->header, GNUNET_NO); 738 send_to_client (client, &cnm->header, GNUNET_NO);
745 } 739 }
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);
diff --git a/src/core/gnunet-service-core_sessions.c b/src/core/gnunet-service-core_sessions.c
index 1f697cf16..7cb880053 100644
--- a/src/core/gnunet-service-core_sessions.c
+++ b/src/core/gnunet-service-core_sessions.c
@@ -176,10 +176,8 @@ GSC_SESSIONS_end (const struct GNUNET_PeerIdentity *pid)
176 session = find_session (pid); 176 session = find_session (pid);
177 if (NULL == session) 177 if (NULL == session)
178 return; 178 return;
179#if DEBUG_CORE
180 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Destroying session for peer `%4s'\n", 179 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Destroying session for peer `%4s'\n",
181 GNUNET_i2s (&session->peer)); 180 GNUNET_i2s (&session->peer));
182#endif
183 if (GNUNET_SCHEDULER_NO_TASK != session->cork_task) 181 if (GNUNET_SCHEDULER_NO_TASK != session->cork_task)
184 { 182 {
185 GNUNET_SCHEDULER_cancel (session->cork_task); 183 GNUNET_SCHEDULER_cancel (session->cork_task);
@@ -255,10 +253,8 @@ GSC_SESSIONS_create (const struct GNUNET_PeerIdentity *peer,
255{ 253{
256 struct Session *session; 254 struct Session *session;
257 255
258#if DEBUG_CORE
259 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Creating session for peer `%4s'\n", 256 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Creating session for peer `%4s'\n",
260 GNUNET_i2s (peer)); 257 GNUNET_i2s (peer));
261#endif
262 session = GNUNET_malloc (sizeof (struct Session)); 258 session = GNUNET_malloc (sizeof (struct Session));
263 session->tmap = GSC_TYPEMAP_create (); 259 session->tmap = GSC_TYPEMAP_create ();
264 session->peer = *peer; 260 session->peer = *peer;
@@ -341,10 +337,8 @@ GSC_SESSIONS_queue_request (struct GSC_ClientActiveRequest *car)
341 session = find_session (&car->target); 337 session = find_session (&car->target);
342 if (session == NULL) 338 if (session == NULL)
343 { 339 {
344#if DEBUG_CORE
345 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 340 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
346 "Dropped client request for transmission (am disconnected)\n"); 341 "Dropped client request for transmission (am disconnected)\n");
347#endif
348 GNUNET_break (0); /* should have been rejected earlier */ 342 GNUNET_break (0); /* should have been rejected earlier */
349 GSC_CLIENTS_reject_request (car); 343 GSC_CLIENTS_reject_request (car);
350 return; 344 return;
@@ -355,10 +349,8 @@ GSC_SESSIONS_queue_request (struct GSC_ClientActiveRequest *car)
355 GSC_CLIENTS_reject_request (car); 349 GSC_CLIENTS_reject_request (car);
356 return; 350 return;
357 } 351 }
358#if DEBUG_CORE
359 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 352 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
360 "Received client transmission request. queueing\n"); 353 "Received client transmission request. queueing\n");
361#endif
362 GNUNET_CONTAINER_DLL_insert (session->active_client_request_head, 354 GNUNET_CONTAINER_DLL_insert (session->active_client_request_head,
363 session->active_client_request_tail, car); 355 session->active_client_request_tail, car);
364 try_transmission (session); 356 try_transmission (session);
diff --git a/src/datacache/datacache.c b/src/datacache/datacache.c
index 936031b91..b440af1b2 100644
--- a/src/datacache/datacache.c
+++ b/src/datacache/datacache.c
@@ -29,7 +29,6 @@
29#include "gnunet_statistics_service.h" 29#include "gnunet_statistics_service.h"
30#include "gnunet_datacache_plugin.h" 30#include "gnunet_datacache_plugin.h"
31 31
32#define DEBUG_DATACACHE GNUNET_EXTRA_LOGGING
33 32
34#define LOG(kind,...) GNUNET_log_from (kind, "datacache", __VA_ARGS__) 33#define LOG(kind,...) GNUNET_log_from (kind, "datacache", __VA_ARGS__)
35 34
@@ -108,10 +107,8 @@ env_delete_notify (void *cls, const GNUNET_HashCode * key, size_t size)
108{ 107{
109 struct GNUNET_DATACACHE_Handle *h = cls; 108 struct GNUNET_DATACACHE_Handle *h = cls;
110 109
111#if DEBUG_DATACACHE
112 LOG (GNUNET_ERROR_TYPE_DEBUG, "Content under key `%s' discarded\n", 110 LOG (GNUNET_ERROR_TYPE_DEBUG, "Content under key `%s' discarded\n",
113 GNUNET_h2s (key)); 111 GNUNET_h2s (key));
114#endif
115 GNUNET_assert (h->utilization >= size); 112 GNUNET_assert (h->utilization >= size);
116 h->utilization -= size; 113 h->utilization -= size;
117 GNUNET_CONTAINER_bloomfilter_remove (h->filter, key); 114 GNUNET_CONTAINER_bloomfilter_remove (h->filter, key);
@@ -248,10 +245,8 @@ GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h,
248 GNUNET_break (0); 245 GNUNET_break (0);
249 return GNUNET_SYSERR; 246 return GNUNET_SYSERR;
250 } 247 }
251#if DEBUG_DATACACHE
252 LOG (GNUNET_ERROR_TYPE_DEBUG, "Stored data under key `%s' in cache\n", 248 LOG (GNUNET_ERROR_TYPE_DEBUG, "Stored data under key `%s' in cache\n",
253 GNUNET_h2s (key)); 249 GNUNET_h2s (key));
254#endif
255 GNUNET_STATISTICS_update (h->stats, gettext_noop ("# bytes stored"), size, 250 GNUNET_STATISTICS_update (h->stats, gettext_noop ("# bytes stored"), size,
256 GNUNET_NO); 251 GNUNET_NO);
257 GNUNET_CONTAINER_bloomfilter_add (h->filter, key); 252 GNUNET_CONTAINER_bloomfilter_add (h->filter, key);
@@ -280,20 +275,16 @@ GNUNET_DATACACHE_get (struct GNUNET_DATACACHE_Handle *h,
280{ 275{
281 GNUNET_STATISTICS_update (h->stats, gettext_noop ("# requests received"), 1, 276 GNUNET_STATISTICS_update (h->stats, gettext_noop ("# requests received"), 1,
282 GNUNET_NO); 277 GNUNET_NO);
283#if DEBUG_DATACACHE
284 LOG (GNUNET_ERROR_TYPE_DEBUG, "Processing request for key `%s'\n", 278 LOG (GNUNET_ERROR_TYPE_DEBUG, "Processing request for key `%s'\n",
285 GNUNET_h2s (key)); 279 GNUNET_h2s (key));
286#endif
287 if (GNUNET_OK != GNUNET_CONTAINER_bloomfilter_test (h->filter, key)) 280 if (GNUNET_OK != GNUNET_CONTAINER_bloomfilter_test (h->filter, key))
288 { 281 {
289 GNUNET_STATISTICS_update (h->stats, 282 GNUNET_STATISTICS_update (h->stats,
290 gettext_noop 283 gettext_noop
291 ("# requests filtered by bloom filter"), 1, 284 ("# requests filtered by bloom filter"), 1,
292 GNUNET_NO); 285 GNUNET_NO);
293#if DEBUG_DATACACHE
294 LOG (GNUNET_ERROR_TYPE_DEBUG, "Bloomfilter filters request for key `%s'\n", 286 LOG (GNUNET_ERROR_TYPE_DEBUG, "Bloomfilter filters request for key `%s'\n",
295 GNUNET_h2s (key)); 287 GNUNET_h2s (key));
296#endif
297 return 0; /* can not be present */ 288 return 0; /* can not be present */
298 } 289 }
299 return h->api->get (h->api->cls, key, type, iter, iter_cls); 290 return h->api->get (h->api->cls, key, type, iter, iter_cls);
diff --git a/src/datacache/plugin_datacache_mysql.c b/src/datacache/plugin_datacache_mysql.c
index d618e07b8..810342908 100644
--- a/src/datacache/plugin_datacache_mysql.c
+++ b/src/datacache/plugin_datacache_mysql.c
@@ -83,7 +83,6 @@
83#include "gnunet_mysql_lib.h" 83#include "gnunet_mysql_lib.h"
84#include <mysql/mysql.h> 84#include <mysql/mysql.h>
85 85
86#define DEBUG_DATACACHE_MYSQL GNUNET_EXTRA_LOGGING
87 86
88/** 87/**
89 * Estimate of the per-entry overhead (including indices). 88 * Estimate of the per-entry overhead (including indices).
diff --git a/src/datacache/plugin_datacache_postgres.c b/src/datacache/plugin_datacache_postgres.c
index cd4286b92..b40f1fd04 100644
--- a/src/datacache/plugin_datacache_postgres.c
+++ b/src/datacache/plugin_datacache_postgres.c
@@ -29,7 +29,7 @@
29#include "gnunet_datacache_plugin.h" 29#include "gnunet_datacache_plugin.h"
30#include <postgresql/libpq-fe.h> 30#include <postgresql/libpq-fe.h>
31 31
32#define DEBUG_POSTGRES GNUNET_EXTRA_LOGGING 32#define LOG(kind,...) GNUNET_log_from (kind, "datacache-postgres", __VA_ARGS__)
33 33
34/** 34/**
35 * Per-entry overhead estimate 35 * Per-entry overhead estimate
@@ -236,20 +236,16 @@ postgres_plugin_get (void *cls, const GNUNET_HashCode * key,
236 GNUNET_POSTGRES_check_result (plugin->dbh, res, PGRES_TUPLES_OK, "PQexecPrepared", 236 GNUNET_POSTGRES_check_result (plugin->dbh, res, PGRES_TUPLES_OK, "PQexecPrepared",
237 (type == 0) ? "getk" : "getkt")) 237 (type == 0) ? "getk" : "getkt"))
238 { 238 {
239#if DEBUG_POSTGRES 239 LOG (GNUNET_ERROR_TYPE_DEBUG,
240 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "datacache-postgres", 240 "Ending iteration (postgres error)\n");
241 "Ending iteration (postgres error)\n");
242#endif
243 return 0; 241 return 0;
244 } 242 }
245 243
246 if (0 == (cnt = PQntuples (res))) 244 if (0 == (cnt = PQntuples (res)))
247 { 245 {
248 /* no result */ 246 /* no result */
249#if DEBUG_POSTGRES 247 LOG (GNUNET_ERROR_TYPE_DEBUG,
250 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "datacache-postgres", 248 "Ending iteration (no more results)\n");
251 "Ending iteration (no more results)\n");
252#endif
253 PQclear (res); 249 PQclear (res);
254 return 0; 250 return 0;
255 } 251 }
@@ -271,19 +267,15 @@ postgres_plugin_get (void *cls, const GNUNET_HashCode * key,
271 GNUNET_ntohll (*(uint64_t *) PQgetvalue (res, i, 0)); 267 GNUNET_ntohll (*(uint64_t *) PQgetvalue (res, i, 0));
272 type = ntohl (*(uint32_t *) PQgetvalue (res, i, 1)); 268 type = ntohl (*(uint32_t *) PQgetvalue (res, i, 1));
273 size = PQgetlength (res, i, 2); 269 size = PQgetlength (res, i, 2);
274#if DEBUG_POSTGRES 270 LOG (GNUNET_ERROR_TYPE_DEBUG,
275 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "datacache-postgres", 271 "Found result of size %u bytes and type %u in database\n",
276 "Found result of size %u bytes and type %u in database\n", 272 (unsigned int) size, (unsigned int) type);
277 (unsigned int) size, (unsigned int) type);
278#endif
279 if (GNUNET_SYSERR == 273 if (GNUNET_SYSERR ==
280 iter (iter_cls, expiration_time, key, size, PQgetvalue (res, i, 2), 274 iter (iter_cls, expiration_time, key, size, PQgetvalue (res, i, 2),
281 (enum GNUNET_BLOCK_Type) type)) 275 (enum GNUNET_BLOCK_Type) type))
282 { 276 {
283#if DEBUG_POSTGRES 277 LOG (GNUNET_ERROR_TYPE_DEBUG,
284 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "datacache-postgres", 278 "Ending iteration (client error)\n");
285 "Ending iteration (client error)\n");
286#endif
287 PQclear (res); 279 PQclear (res);
288 return cnt; 280 return cnt;
289 } 281 }
@@ -313,19 +305,15 @@ postgres_plugin_del (void *cls)
313 if (GNUNET_OK != 305 if (GNUNET_OK !=
314 GNUNET_POSTGRES_check_result (plugin->dbh, res, PGRES_TUPLES_OK, "PQexecPrepared", "getm")) 306 GNUNET_POSTGRES_check_result (plugin->dbh, res, PGRES_TUPLES_OK, "PQexecPrepared", "getm"))
315 { 307 {
316#if DEBUG_POSTGRES 308 LOG (GNUNET_ERROR_TYPE_DEBUG,
317 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "datacache-postgres", 309 "Ending iteration (postgres error)\n");
318 "Ending iteration (postgres error)\n");
319#endif
320 return 0; 310 return 0;
321 } 311 }
322 if (0 == PQntuples (res)) 312 if (0 == PQntuples (res))
323 { 313 {
324 /* no result */ 314 /* no result */
325#if DEBUG_POSTGRES 315 LOG (GNUNET_ERROR_TYPE_DEBUG,
326 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "datacache-postgres", 316 "Ending iteration (no more results)\n");
327 "Ending iteration (no more results)\n");
328#endif
329 PQclear (res); 317 PQclear (res);
330 return GNUNET_SYSERR; 318 return GNUNET_SYSERR;
331 } 319 }
@@ -375,8 +363,8 @@ libgnunet_plugin_datacache_postgres_init (void *cls)
375 api->get = &postgres_plugin_get; 363 api->get = &postgres_plugin_get;
376 api->put = &postgres_plugin_put; 364 api->put = &postgres_plugin_put;
377 api->del = &postgres_plugin_del; 365 api->del = &postgres_plugin_del;
378 GNUNET_log_from (GNUNET_ERROR_TYPE_INFO, "datacache-postgres", 366 LOG (GNUNET_ERROR_TYPE_INFO,
379 _("Postgres datacache running\n")); 367 _("Postgres datacache running\n"));
380 return api; 368 return api;
381} 369}
382 370
diff --git a/src/datacache/plugin_datacache_sqlite.c b/src/datacache/plugin_datacache_sqlite.c
index f852d3b06..db27de3e2 100644
--- a/src/datacache/plugin_datacache_sqlite.c
+++ b/src/datacache/plugin_datacache_sqlite.c
@@ -28,8 +28,6 @@
28#include "gnunet_datacache_plugin.h" 28#include "gnunet_datacache_plugin.h"
29#include <sqlite3.h> 29#include <sqlite3.h>
30 30
31#define DEBUG_DATACACHE_SQLITE GNUNET_EXTRA_LOGGING
32
33#define LOG(kind,...) GNUNET_log_from (kind, "datacache-sqlite", __VA_ARGS__) 31#define LOG(kind,...) GNUNET_log_from (kind, "datacache-sqlite", __VA_ARGS__)
34 32
35#define LOG_STRERROR_FILE(kind,op,fn) GNUNET_log_from_strerror_file (kind, "datacache-sqlite", op, fn) 33#define LOG_STRERROR_FILE(kind,op,fn) GNUNET_log_from_strerror_file (kind, "datacache-sqlite", op, fn)
@@ -108,13 +106,11 @@ sqlite_plugin_put (void *cls, const GNUNET_HashCode * key, size_t size,
108 sqlite3_stmt *stmt; 106 sqlite3_stmt *stmt;
109 int64_t dval; 107 int64_t dval;
110 108
111#if DEBUG_DATACACHE_SQLITE
112 LOG (GNUNET_ERROR_TYPE_DEBUG, 109 LOG (GNUNET_ERROR_TYPE_DEBUG,
113 "Processing `%s' of %u bytes with key `%4s' and expiration %llums\n", 110 "Processing `%s' of %u bytes with key `%4s' and expiration %llums\n",
114 "PUT", (unsigned int) size, GNUNET_h2s (key), 111 "PUT", (unsigned int) size, GNUNET_h2s (key),
115 (unsigned long long) 112 (unsigned long long)
116 GNUNET_TIME_absolute_get_remaining (discard_time).rel_value); 113 GNUNET_TIME_absolute_get_remaining (discard_time).rel_value);
117#endif
118 dval = (int64_t) discard_time.abs_value; 114 dval = (int64_t) discard_time.abs_value;
119 if (dval < 0) 115 if (dval < 0)
120 dval = INT64_MAX; 116 dval = INT64_MAX;
@@ -182,10 +178,8 @@ sqlite_plugin_get (void *cls, const GNUNET_HashCode * key,
182 int64_t ntime; 178 int64_t ntime;
183 179
184 now = GNUNET_TIME_absolute_get (); 180 now = GNUNET_TIME_absolute_get ();
185#if DEBUG_DATACACHE_SQLITE
186 LOG (GNUNET_ERROR_TYPE_DEBUG, "Processing `%s' for key `%4s'\n", "GET", 181 LOG (GNUNET_ERROR_TYPE_DEBUG, "Processing `%s' for key `%4s'\n", "GET",
187 GNUNET_h2s (key)); 182 GNUNET_h2s (key));
188#endif
189 if (sq_prepare 183 if (sq_prepare
190 (plugin->dbh, 184 (plugin->dbh,
191 "SELECT count(*) FROM ds090 WHERE key=? AND type=? AND expire >= ?", 185 "SELECT count(*) FROM ds090 WHERE key=? AND type=? AND expire >= ?",
@@ -214,23 +208,19 @@ sqlite_plugin_get (void *cls, const GNUNET_HashCode * key,
214 LOG_SQLITE (plugin->dbh, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, 208 LOG_SQLITE (plugin->dbh, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
215 "sqlite_step"); 209 "sqlite_step");
216 sqlite3_finalize (stmt); 210 sqlite3_finalize (stmt);
217#if DEBUG_DATACACHE_SQLITE
218 LOG (GNUNET_ERROR_TYPE_DEBUG, 211 LOG (GNUNET_ERROR_TYPE_DEBUG,
219 "No content found when processing `%s' for key `%4s'\n", "GET", 212 "No content found when processing `%s' for key `%4s'\n", "GET",
220 GNUNET_h2s (key)); 213 GNUNET_h2s (key));
221#endif
222 return 0; 214 return 0;
223 } 215 }
224 total = sqlite3_column_int (stmt, 0); 216 total = sqlite3_column_int (stmt, 0);
225 sqlite3_finalize (stmt); 217 sqlite3_finalize (stmt);
226 if ((total == 0) || (iter == NULL)) 218 if ((total == 0) || (iter == NULL))
227 { 219 {
228#if DEBUG_DATACACHE_SQLITE
229 if (0 == total) 220 if (0 == total)
230 LOG (GNUNET_ERROR_TYPE_DEBUG, 221 LOG (GNUNET_ERROR_TYPE_DEBUG,
231 "No content found when processing `%s' for key `%4s'\n", "GET", 222 "No content found when processing `%s' for key `%4s'\n", "GET",
232 GNUNET_h2s (key)); 223 GNUNET_h2s (key));
233#endif
234 return total; 224 return total;
235 } 225 }
236 226
@@ -268,11 +258,9 @@ sqlite_plugin_get (void *cls, const GNUNET_HashCode * key,
268 if (ntime == INT64_MAX) 258 if (ntime == INT64_MAX)
269 exp = GNUNET_TIME_UNIT_FOREVER_ABS; 259 exp = GNUNET_TIME_UNIT_FOREVER_ABS;
270 cnt++; 260 cnt++;
271#if DEBUG_DATACACHE_SQLITE
272 LOG (GNUNET_ERROR_TYPE_DEBUG, 261 LOG (GNUNET_ERROR_TYPE_DEBUG,
273 "Found %u-byte result when processing `%s' for key `%4s'\n", 262 "Found %u-byte result when processing `%s' for key `%4s'\n",
274 (unsigned int) size, "GET", GNUNET_h2s (key)); 263 (unsigned int) size, "GET", GNUNET_h2s (key));
275#endif
276 if (GNUNET_OK != iter (iter_cls, exp, key, size, dat, type)) 264 if (GNUNET_OK != iter (iter_cls, exp, key, size, dat, type))
277 { 265 {
278 sqlite3_finalize (stmt); 266 sqlite3_finalize (stmt);
@@ -301,9 +289,7 @@ sqlite_plugin_del (void *cls)
301 sqlite3_stmt *dstmt; 289 sqlite3_stmt *dstmt;
302 GNUNET_HashCode hc; 290 GNUNET_HashCode hc;
303 291
304#if DEBUG_DATACACHE_SQLITE
305 LOG (GNUNET_ERROR_TYPE_DEBUG, "Processing `%s'\n", "DEL"); 292 LOG (GNUNET_ERROR_TYPE_DEBUG, "Processing `%s'\n", "DEL");
306#endif
307 stmt = NULL; 293 stmt = NULL;
308 dstmt = NULL; 294 dstmt = NULL;
309 if (sq_prepare 295 if (sq_prepare
@@ -458,15 +444,11 @@ libgnunet_plugin_datacache_sqlite_done (void *cls)
458 stmt = sqlite3_next_stmt (plugin->dbh, NULL); 444 stmt = sqlite3_next_stmt (plugin->dbh, NULL);
459 while (stmt != NULL) 445 while (stmt != NULL)
460 { 446 {
461#if DEBUG_SQLITE
462 LOG (GNUNET_ERROR_TYPE_DEBUG, "Closing statement %p\n", stmt); 447 LOG (GNUNET_ERROR_TYPE_DEBUG, "Closing statement %p\n", stmt);
463#endif
464 result = sqlite3_finalize (stmt); 448 result = sqlite3_finalize (stmt);
465#if DEBUG_SQLITE
466 if (result != SQLITE_OK) 449 if (result != SQLITE_OK)
467 LOG (GNUNET_ERROR_TYPE_DEBUG, "Failed to close statement %p: %d\n", 450 LOG (GNUNET_ERROR_TYPE_WARNING, _("Failed to close statement %p: %d\n"),
468 stmt, result); 451 stmt, result);
469#endif
470 stmt = sqlite3_next_stmt (plugin->dbh, NULL); 452 stmt = sqlite3_next_stmt (plugin->dbh, NULL);
471 } 453 }
472 result = sqlite3_close (plugin->dbh); 454 result = sqlite3_close (plugin->dbh);
diff --git a/src/datastore/datastore.h b/src/datastore/datastore.h
index c8b2c722b..87ceb0134 100644
--- a/src/datastore/datastore.h
+++ b/src/datastore/datastore.h
@@ -27,7 +27,6 @@
27#ifndef DATASTORE_H 27#ifndef DATASTORE_H
28#define DATASTORE_H 28#define DATASTORE_H
29 29
30#define DEBUG_DATASTORE GNUNET_EXTRA_LOGGING
31 30
32#include "gnunet_util_lib.h" 31#include "gnunet_util_lib.h"
33 32
diff --git a/src/datastore/gnunet-service-datastore.c b/src/datastore/gnunet-service-datastore.c
index 863cd3902..49b9db859 100644
--- a/src/datastore/gnunet-service-datastore.c
+++ b/src/datastore/gnunet-service-datastore.c
@@ -341,12 +341,10 @@ expired_processor (void *cls, const GNUNET_HashCode * key, uint32_t size,
341 &delete_expired, NULL); 341 &delete_expired, NULL);
342 return GNUNET_SYSERR; 342 return GNUNET_SYSERR;
343 } 343 }
344#if DEBUG_DATASTORE
345 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 344 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
346 "Deleting content `%s' of type %u that expired %llu ms ago\n", 345 "Deleting content `%s' of type %u that expired %llu ms ago\n",
347 GNUNET_h2s (key), type, 346 GNUNET_h2s (key), type,
348 (unsigned long long) (now.abs_value - expiration.abs_value)); 347 (unsigned long long) (now.abs_value - expiration.abs_value));
349#endif
350 min_expiration = now; 348 min_expiration = now;
351 GNUNET_STATISTICS_update (stats, gettext_noop ("# bytes expired"), size, 349 GNUNET_STATISTICS_update (stats, gettext_noop ("# bytes expired"), size,
352 GNUNET_YES); 350 GNUNET_YES);
@@ -405,7 +403,6 @@ quota_processor (void *cls, const GNUNET_HashCode * key, uint32_t size,
405 403
406 if (NULL == key) 404 if (NULL == key)
407 return GNUNET_SYSERR; 405 return GNUNET_SYSERR;
408#if DEBUG_DATASTORE
409 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 406 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
410 "Deleting %llu bytes of low-priority (%u) content `%s' of type %u at %llu ms prior to expiration (still trying to free another %llu bytes)\n", 407 "Deleting %llu bytes of low-priority (%u) content `%s' of type %u at %llu ms prior to expiration (still trying to free another %llu bytes)\n",
411 (unsigned long long) (size + GNUNET_DATASTORE_ENTRY_OVERHEAD), 408 (unsigned long long) (size + GNUNET_DATASTORE_ENTRY_OVERHEAD),
@@ -413,7 +410,6 @@ quota_processor (void *cls, const GNUNET_HashCode * key, uint32_t size,
413 GNUNET_h2s (key), type, 410 GNUNET_h2s (key), type,
414 (unsigned long long) GNUNET_TIME_absolute_get_remaining (expiration).rel_value, 411 (unsigned long long) GNUNET_TIME_absolute_get_remaining (expiration).rel_value,
415 *need); 412 *need);
416#endif
417 if (size + GNUNET_DATASTORE_ENTRY_OVERHEAD > *need) 413 if (size + GNUNET_DATASTORE_ENTRY_OVERHEAD > *need)
418 *need = 0; 414 *need = 0;
419 else 415 else
@@ -447,10 +443,8 @@ manage_space (unsigned long long need)
447{ 443{
448 unsigned long long last; 444 unsigned long long last;
449 445
450#if DEBUG_DATASTORE
451 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 446 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
452 "Asked to free up %llu bytes of cache space\n", need); 447 "Asked to free up %llu bytes of cache space\n", need);
453#endif
454 last = 0; 448 last = 0;
455 while ((need > 0) && (last != need)) 449 while ((need > 0) && (last != need))
456 { 450 {
@@ -513,10 +507,8 @@ transmit (struct GNUNET_SERVER_Client *client, struct GNUNET_MessageHeader *msg)
513 507
514 if (GNUNET_YES == cleaning_done) 508 if (GNUNET_YES == cleaning_done)
515 { 509 {
516#if DEBUG_DATASTORE
517 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 510 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
518 "Shutdown in progress, aborting transmission.\n"); 511 _("Shutdown in progress, aborting transmission.\n"));
519#endif
520 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); 512 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
521 GNUNET_free (msg); 513 GNUNET_free (msg);
522 return; 514 return;
@@ -554,11 +546,9 @@ transmit_status (struct GNUNET_SERVER_Client *client, int code, const char *msg)
554 struct StatusMessage *sm; 546 struct StatusMessage *sm;
555 size_t slen; 547 size_t slen;
556 548
557#if DEBUG_DATASTORE
558 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 549 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
559 "Transmitting `%s' message with value %d and message `%s'\n", 550 "Transmitting `%s' message with value %d and message `%s'\n",
560 "STATUS", code, msg != NULL ? msg : "(none)"); 551 "STATUS", code, msg != NULL ? msg : "(none)");
561#endif
562 slen = (msg == NULL) ? 0 : strlen (msg) + 1; 552 slen = (msg == NULL) ? 0 : strlen (msg) + 1;
563 sm = GNUNET_malloc (sizeof (struct StatusMessage) + slen); 553 sm = GNUNET_malloc (sizeof (struct StatusMessage) + slen);
564 sm->header.size = htons (sizeof (struct StatusMessage) + slen); 554 sm->header.size = htons (sizeof (struct StatusMessage) + slen);
@@ -603,10 +593,8 @@ transmit_item (void *cls, const GNUNET_HashCode * key, uint32_t size,
603 if (key == NULL) 593 if (key == NULL)
604 { 594 {
605 /* transmit 'DATA_END' */ 595 /* transmit 'DATA_END' */
606#if DEBUG_DATASTORE
607 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transmitting `%s' message\n", 596 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transmitting `%s' message\n",
608 "DATA_END"); 597 "DATA_END");
609#endif
610 end = GNUNET_malloc (sizeof (struct GNUNET_MessageHeader)); 598 end = GNUNET_malloc (sizeof (struct GNUNET_MessageHeader));
611 end->size = htons (sizeof (struct GNUNET_MessageHeader)); 599 end->size = htons (sizeof (struct GNUNET_MessageHeader));
612 end->type = htons (GNUNET_MESSAGE_TYPE_DATASTORE_DATA_END); 600 end->type = htons (GNUNET_MESSAGE_TYPE_DATASTORE_DATA_END);
@@ -630,13 +618,11 @@ transmit_item (void *cls, const GNUNET_HashCode * key, uint32_t size,
630 dm->uid = GNUNET_htonll (uid); 618 dm->uid = GNUNET_htonll (uid);
631 dm->key = *key; 619 dm->key = *key;
632 memcpy (&dm[1], data, size); 620 memcpy (&dm[1], data, size);
633#if DEBUG_DATASTORE
634 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 621 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
635 "Transmitting `%s' message for `%s' of type %u with expiration %llu (now: %llu)\n", 622 "Transmitting `%s' message for `%s' of type %u with expiration %llu (now: %llu)\n",
636 "DATA", GNUNET_h2s (key), type, 623 "DATA", GNUNET_h2s (key), type,
637 (unsigned long long) expiration.abs_value, 624 (unsigned long long) expiration.abs_value,
638 (unsigned long long) GNUNET_TIME_absolute_get ().abs_value); 625 (unsigned long long) GNUNET_TIME_absolute_get ().abs_value);
639#endif
640 GNUNET_STATISTICS_update (stats, gettext_noop ("# results found"), 1, 626 GNUNET_STATISTICS_update (stats, gettext_noop ("# results found"), 1,
641 GNUNET_NO); 627 GNUNET_NO);
642 transmit (client, &dm->header); 628 transmit (client, &dm->header);
@@ -668,9 +654,7 @@ handle_reserve (void *cls, struct GNUNET_SERVER_Client *client,
668 uint64_t amount; 654 uint64_t amount;
669 uint32_t entries; 655 uint32_t entries;
670 656
671#if DEBUG_DATASTORE
672 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing `%s' request\n", "RESERVE"); 657 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing `%s' request\n", "RESERVE");
673#endif
674 amount = GNUNET_ntohll (msg->amount); 658 amount = GNUNET_ntohll (msg->amount);
675 entries = ntohl (msg->entries); 659 entries = ntohl (msg->entries);
676 used = payload + reserved; 660 used = payload + reserved;
@@ -742,10 +726,8 @@ handle_release_reserve (void *cls, struct GNUNET_SERVER_Client *client,
742 int rid = ntohl (msg->rid); 726 int rid = ntohl (msg->rid);
743 unsigned long long rem; 727 unsigned long long rem;
744 728
745#if DEBUG_DATASTORE
746 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing `%s' request\n", 729 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing `%s' request\n",
747 "RELEASE_RESERVE"); 730 "RELEASE_RESERVE");
748#endif
749 next = reservations; 731 next = reservations;
750 prev = NULL; 732 prev = NULL;
751 while (NULL != (pos = next)) 733 while (NULL != (pos = next))
@@ -764,11 +746,9 @@ handle_release_reserve (void *cls, struct GNUNET_SERVER_Client *client,
764 reserved -= rem; 746 reserved -= rem;
765 GNUNET_STATISTICS_set (stats, gettext_noop ("# reserved"), reserved, 747 GNUNET_STATISTICS_set (stats, gettext_noop ("# reserved"), reserved,
766 GNUNET_NO); 748 GNUNET_NO);
767#if DEBUG_DATASTORE
768 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 749 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
769 "Returning %llu remaining reserved bytes to storage pool\n", 750 "Returning %llu remaining reserved bytes to storage pool\n",
770 rem); 751 rem);
771#endif
772 GNUNET_free (pos); 752 GNUNET_free (pos);
773 transmit_status (client, GNUNET_OK, NULL); 753 transmit_status (client, GNUNET_OK, NULL);
774 return; 754 return;
@@ -854,11 +834,9 @@ execute_put (struct GNUNET_SERVER_Client *client, const struct DataMessage *dm)
854 GNUNET_STATISTICS_update (stats, gettext_noop ("# bytes stored"), size, 834 GNUNET_STATISTICS_update (stats, gettext_noop ("# bytes stored"), size,
855 GNUNET_YES); 835 GNUNET_YES);
856 GNUNET_CONTAINER_bloomfilter_add (filter, &dm->key); 836 GNUNET_CONTAINER_bloomfilter_add (filter, &dm->key);
857#if DEBUG_DATASTORE
858 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 837 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
859 "Successfully stored %u bytes of type %u under key `%s'\n", 838 "Successfully stored %u bytes of type %u under key `%s'\n",
860 size, ntohl (dm->type), GNUNET_h2s (&dm->key)); 839 size, ntohl (dm->type), GNUNET_h2s (&dm->key));
861#endif
862 } 840 }
863 transmit_status (client, ret, msg); 841 transmit_status (client, ret, msg);
864 GNUNET_free_non_null (msg); 842 GNUNET_free_non_null (msg);
@@ -914,10 +892,8 @@ check_present (void *cls, const GNUNET_HashCode * key, uint32_t size,
914 (0 == 892 (0 ==
915 memcmp (&dm[1], data, size)))) 893 memcmp (&dm[1], data, size))))
916 { 894 {
917#if DEBUG_MYSQL
918 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 895 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
919 "Result already present in datastore\n"); 896 "Result already present in datastore\n");
920#endif
921 /* FIXME: change API to allow increasing 'replication' counter */ 897 /* FIXME: change API to allow increasing 'replication' counter */
922 if ((ntohl (dm->priority) > 0) || 898 if ((ntohl (dm->priority) > 0) ||
923 (GNUNET_TIME_absolute_ntoh (dm->expiration).abs_value > 899 (GNUNET_TIME_absolute_ntoh (dm->expiration).abs_value >
@@ -963,11 +939,9 @@ handle_put (void *cls, struct GNUNET_SERVER_Client *client,
963 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); 939 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
964 return; 940 return;
965 } 941 }
966#if DEBUG_DATASTORE
967 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 942 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
968 "Processing `%s' request for `%s' of type %u\n", "PUT", 943 "Processing `%s' request for `%s' of type %u\n", "PUT",
969 GNUNET_h2s (&dm->key), ntohl (dm->type)); 944 GNUNET_h2s (&dm->key), ntohl (dm->type));
970#endif
971 rid = ntohl (dm->rid); 945 rid = ntohl (dm->rid);
972 size = ntohl (dm->size); 946 size = ntohl (dm->size);
973 if (rid > 0) 947 if (rid > 0)
@@ -1026,11 +1000,9 @@ handle_get (void *cls, struct GNUNET_SERVER_Client *client,
1026 return; 1000 return;
1027 } 1001 }
1028 msg = (const struct GetMessage *) message; 1002 msg = (const struct GetMessage *) message;
1029#if DEBUG_DATASTORE
1030 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1003 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1031 "Processing `%s' request for `%s' of type %u\n", "GET", 1004 "Processing `%s' request for `%s' of type %u\n", "GET",
1032 GNUNET_h2s (&msg->key), ntohl (msg->type)); 1005 GNUNET_h2s (&msg->key), ntohl (msg->type));
1033#endif
1034 GNUNET_STATISTICS_update (stats, gettext_noop ("# GET requests received"), 1, 1006 GNUNET_STATISTICS_update (stats, gettext_noop ("# GET requests received"), 1,
1035 GNUNET_NO); 1007 GNUNET_NO);
1036 GNUNET_SERVER_client_keep (client); 1008 GNUNET_SERVER_client_keep (client);
@@ -1038,11 +1010,9 @@ handle_get (void *cls, struct GNUNET_SERVER_Client *client,
1038 (GNUNET_YES != GNUNET_CONTAINER_bloomfilter_test (filter, &msg->key))) 1010 (GNUNET_YES != GNUNET_CONTAINER_bloomfilter_test (filter, &msg->key)))
1039 { 1011 {
1040 /* don't bother database... */ 1012 /* don't bother database... */
1041#if DEBUG_DATASTORE
1042 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1013 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1043 "Empty result set for `%s' request for `%s' (bloomfilter).\n", 1014 "Empty result set for `%s' request for `%s' (bloomfilter).\n",
1044 "GET", GNUNET_h2s (&msg->key)); 1015 "GET", GNUNET_h2s (&msg->key));
1045#endif
1046 GNUNET_STATISTICS_update (stats, 1016 GNUNET_STATISTICS_update (stats,
1047 gettext_noop 1017 gettext_noop
1048 ("# requests filtered by bloomfilter"), 1, 1018 ("# requests filtered by bloomfilter"), 1,
@@ -1077,10 +1047,8 @@ handle_update (void *cls, struct GNUNET_SERVER_Client *client,
1077 1, GNUNET_NO); 1047 1, GNUNET_NO);
1078 msg = (const struct UpdateMessage *) message; 1048 msg = (const struct UpdateMessage *) message;
1079 emsg = NULL; 1049 emsg = NULL;
1080#if DEBUG_DATASTORE
1081 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing `%s' request for %llu\n", 1050 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing `%s' request for %llu\n",
1082 "UPDATE", (unsigned long long) GNUNET_ntohll (msg->uid)); 1051 "UPDATE", (unsigned long long) GNUNET_ntohll (msg->uid));
1083#endif
1084 ret = 1052 ret =
1085 plugin->api->update (plugin->api->cls, GNUNET_ntohll (msg->uid), 1053 plugin->api->update (plugin->api->cls, GNUNET_ntohll (msg->uid),
1086 (int32_t) ntohl (msg->priority), 1054 (int32_t) ntohl (msg->priority),
@@ -1101,10 +1069,8 @@ static void
1101handle_get_replication (void *cls, struct GNUNET_SERVER_Client *client, 1069handle_get_replication (void *cls, struct GNUNET_SERVER_Client *client,
1102 const struct GNUNET_MessageHeader *message) 1070 const struct GNUNET_MessageHeader *message)
1103{ 1071{
1104#if DEBUG_DATASTORE
1105 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing `%s' request\n", 1072 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing `%s' request\n",
1106 "GET_REPLICATION"); 1073 "GET_REPLICATION");
1107#endif
1108 GNUNET_STATISTICS_update (stats, 1074 GNUNET_STATISTICS_update (stats,
1109 gettext_noop 1075 gettext_noop
1110 ("# GET REPLICATION requests received"), 1, 1076 ("# GET REPLICATION requests received"), 1,
@@ -1136,10 +1102,8 @@ handle_get_zero_anonymity (void *cls, struct GNUNET_SERVER_Client *client,
1136 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); 1102 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
1137 return; 1103 return;
1138 } 1104 }
1139#if DEBUG_DATASTORE
1140 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing `%s' request\n", 1105 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing `%s' request\n",
1141 "GET_ZERO_ANONYMITY"); 1106 "GET_ZERO_ANONYMITY");
1142#endif
1143 GNUNET_STATISTICS_update (stats, 1107 GNUNET_STATISTICS_update (stats,
1144 gettext_noop 1108 gettext_noop
1145 ("# GET ZERO ANONYMITY requests received"), 1, 1109 ("# GET ZERO ANONYMITY requests received"), 1,
@@ -1165,19 +1129,15 @@ remove_callback (void *cls, const GNUNET_HashCode * key, uint32_t size,
1165 1129
1166 if (key == NULL) 1130 if (key == NULL)
1167 { 1131 {
1168#if DEBUG_DATASTORE
1169 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1132 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1170 "No further matches for `%s' request.\n", "REMOVE"); 1133 "No further matches for `%s' request.\n", "REMOVE");
1171#endif
1172 transmit_status (client, GNUNET_NO, _("Content not found")); 1134 transmit_status (client, GNUNET_NO, _("Content not found"));
1173 GNUNET_SERVER_client_drop (client); 1135 GNUNET_SERVER_client_drop (client);
1174 return GNUNET_OK; /* last item */ 1136 return GNUNET_OK; /* last item */
1175 } 1137 }
1176#if DEBUG_DATASTORE
1177 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1138 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1178 "Item %llu matches `%s' request for key `%s' and type %u.\n", 1139 "Item %llu matches `%s' request for key `%s' and type %u.\n",
1179 (unsigned long long) uid, "REMOVE", GNUNET_h2s (key), type); 1140 (unsigned long long) uid, "REMOVE", GNUNET_h2s (key), type);
1180#endif
1181 GNUNET_STATISTICS_update (stats, 1141 GNUNET_STATISTICS_update (stats,
1182 gettext_noop ("# bytes removed (explicit request)"), 1142 gettext_noop ("# bytes removed (explicit request)"),
1183 size, GNUNET_YES); 1143 size, GNUNET_YES);
@@ -1208,11 +1168,9 @@ handle_remove (void *cls, struct GNUNET_SERVER_Client *client,
1208 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); 1168 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
1209 return; 1169 return;
1210 } 1170 }
1211#if DEBUG_DATASTORE
1212 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1171 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1213 "Processing `%s' request for `%s' of type %u\n", "REMOVE", 1172 "Processing `%s' request for `%s' of type %u\n", "REMOVE",
1214 GNUNET_h2s (&dm->key), ntohl (dm->type)); 1173 GNUNET_h2s (&dm->key), ntohl (dm->type));
1215#endif
1216 GNUNET_STATISTICS_update (stats, gettext_noop ("# REMOVE requests received"), 1174 GNUNET_STATISTICS_update (stats, gettext_noop ("# REMOVE requests received"),
1217 1, GNUNET_NO); 1175 1, GNUNET_NO);
1218 GNUNET_SERVER_client_keep (client); 1176 GNUNET_SERVER_client_keep (client);
@@ -1234,9 +1192,7 @@ static void
1234handle_drop (void *cls, struct GNUNET_SERVER_Client *client, 1192handle_drop (void *cls, struct GNUNET_SERVER_Client *client,
1235 const struct GNUNET_MessageHeader *message) 1193 const struct GNUNET_MessageHeader *message)
1236{ 1194{
1237#if DEBUG_DATASTORE
1238 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing `%s' request\n", "DROP"); 1195 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing `%s' request\n", "DROP");
1239#endif
1240 do_drop = GNUNET_YES; 1196 do_drop = GNUNET_YES;
1241 GNUNET_SERVER_receive_done (client, GNUNET_OK); 1197 GNUNET_SERVER_receive_done (client, GNUNET_OK);
1242} 1198}
@@ -1287,11 +1243,9 @@ process_stat_in (void *cls, const char *subsystem, const char *name,
1287 GNUNET_assert (stats_worked == GNUNET_NO); 1243 GNUNET_assert (stats_worked == GNUNET_NO);
1288 stats_worked = GNUNET_YES; 1244 stats_worked = GNUNET_YES;
1289 payload += value; 1245 payload += value;
1290#if DEBUG_SQLITE
1291 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1246 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1292 "Notification from statistics about existing payload (%llu), new payload is %llu\n", 1247 "Notification from statistics about existing payload (%llu), new payload is %llu\n",
1293 abs_value, payload); 1248 value, payload);
1294#endif
1295 return GNUNET_OK; 1249 return GNUNET_OK;
1296} 1250}
1297 1251
@@ -1348,10 +1302,8 @@ load_plugin ()
1348static void 1302static void
1349unload_plugin (struct DatastorePlugin *plug) 1303unload_plugin (struct DatastorePlugin *plug)
1350{ 1304{
1351#if DEBUG_DATASTORE
1352 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1305 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1353 "Datastore service is unloading plugin...\n"); 1306 "Datastore service is unloading plugin...\n");
1354#endif
1355 GNUNET_break (NULL == GNUNET_PLUGIN_unload (plug->lib_name, plug->api)); 1307 GNUNET_break (NULL == GNUNET_PLUGIN_unload (plug->lib_name, plug->api));
1356 GNUNET_free (plug->lib_name); 1308 GNUNET_free (plug->lib_name);
1357 GNUNET_free (plug->short_name); 1309 GNUNET_free (plug->short_name);
diff --git a/src/dht/gnunet-service-dht_datacache.c b/src/dht/gnunet-service-dht_datacache.c
index 82cd06727..4d1dd6f68 100644
--- a/src/dht/gnunet-service-dht_datacache.c
+++ b/src/dht/gnunet-service-dht_datacache.c
@@ -193,11 +193,9 @@ datacache_get_iterator (void *cls, struct GNUNET_TIME_Absolute exp,
193 GNUNET_BLOCK_evaluate (GDS_block_context, type, key, ctx->reply_bf, 193 GNUNET_BLOCK_evaluate (GDS_block_context, type, key, ctx->reply_bf,
194 ctx->reply_bf_mutator, ctx->xquery, 194 ctx->reply_bf_mutator, ctx->xquery,
195 ctx->xquery_size, rdata, rdata_size); 195 ctx->xquery_size, rdata, rdata_size);
196#if DEBUG_DHT
197 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 196 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
198 "Found reply for query %s in datacache, evaluation result is %d\n", 197 "Found reply for query %s in datacache, evaluation result is %d\n",
199 GNUNET_h2s (key), (int) eval); 198 GNUNET_h2s (key), (int) eval);
200#endif
201 ctx->eval = eval; 199 ctx->eval = eval;
202 switch (eval) 200 switch (eval)
203 { 201 {
diff --git a/src/dns/dns.h b/src/dns/dns.h
index 2b0ad0376..ee95d9c73 100644
--- a/src/dns/dns.h
+++ b/src/dns/dns.h
@@ -23,8 +23,8 @@
23 * @brief IPC messages between DNS API and DNS service 23 * @brief IPC messages between DNS API and DNS service
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 */ 25 */
26#ifndef DNS_NEW_H 26#ifndef DNS_H
27#define DNS_NEW_H 27#define DNS_H
28 28
29GNUNET_NETWORK_STRUCT_BEGIN 29GNUNET_NETWORK_STRUCT_BEGIN
30 30
diff --git a/src/dns/gnunet-service-dns.c b/src/dns/gnunet-service-dns.c
index b4d64e0d9..3a8aa054e 100644
--- a/src/dns/gnunet-service-dns.c
+++ b/src/dns/gnunet-service-dns.c
@@ -1196,10 +1196,8 @@ handle_client_response (void *cls GNUNET_UNUSED,
1196 return; 1196 return;
1197 } 1197 }
1198 GNUNET_free_non_null (rr->payload); 1198 GNUNET_free_non_null (rr->payload);
1199#if DEBUG_DNS
1200 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1199 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1201 _("Changing DNS reply according to client specifications\n")); 1200 "Changing DNS reply according to client specifications\n");
1202#endif
1203 rr->payload = GNUNET_malloc (msize); 1201 rr->payload = GNUNET_malloc (msize);
1204 rr->payload_length = msize; 1202 rr->payload_length = msize;
1205 memcpy (rr->payload, &resp[1], msize); 1203 memcpy (rr->payload, &resp[1], msize);
diff --git a/src/fs/test_fs.c b/src/fs/test_fs.c
index 9aee89e85..5ec5ab053 100644
--- a/src/fs/test_fs.c
+++ b/src/fs/test_fs.c
@@ -19,8 +19,8 @@
19*/ 19*/
20 20
21/** 21/**
22 * @file applications/fs/fsui/basic_fsui_test.c 22 * @file fs/test_fs.c
23 * @brief testcase for fsui (upload-search-download-unindex) 23 * @brief testcase for FS (upload-search-download-unindex)
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 */ 25 */
26 26
@@ -248,4 +248,4 @@ FAILURE:
248 return (ok == GNUNET_YES) ? 0 : 1; 248 return (ok == GNUNET_YES) ? 0 : 1;
249} 249}
250 250
251/* end of basic_fsui_test.c */ 251/* end of test_fs.c */
diff --git a/src/nat/gnunet-nat-server.c b/src/nat/gnunet-nat-server.c
index 0336ecc9d..9b6846cf0 100644
--- a/src/nat/gnunet-nat-server.c
+++ b/src/nat/gnunet-nat-server.c
@@ -55,11 +55,9 @@ try_anat (uint32_t dst_ipv4, uint16_t dport, int is_tcp)
55 struct GNUNET_NAT_Handle *h; 55 struct GNUNET_NAT_Handle *h;
56 struct sockaddr_in sa; 56 struct sockaddr_in sa;
57 57
58#if DEBUG_NAT
59 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 58 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
60 "Asking for connection reversal with %x and code %u\n", 59 "Asking for connection reversal with %x and code %u\n",
61 (unsigned int) dst_ipv4, (unsigned int) dport); 60 (unsigned int) dst_ipv4, (unsigned int) dport);
62#endif
63 h = GNUNET_NAT_register (cfg, is_tcp, dport, 0, NULL, NULL, NULL, NULL, NULL); 61 h = GNUNET_NAT_register (cfg, is_tcp, dport, 0, NULL, NULL, NULL, NULL, NULL);
64 memset (&sa, 0, sizeof (sa)); 62 memset (&sa, 0, sizeof (sa));
65 sa.sin_family = AF_INET; 63 sa.sin_family = AF_INET;
@@ -107,9 +105,7 @@ tcp_send (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
107 if (-1 == 105 if (-1 ==
108 GNUNET_NETWORK_socket_send (ctx->s, &ctx->data, sizeof (ctx->data))) 106 GNUNET_NETWORK_socket_send (ctx->s, &ctx->data, sizeof (ctx->data)))
109 { 107 {
110#if DEBUG_NAT
111 GNUNET_log_strerror (GNUNET_ERROR_TYPE_DEBUG, "send"); 108 GNUNET_log_strerror (GNUNET_ERROR_TYPE_DEBUG, "send");
112#endif
113 } 109 }
114 GNUNET_NETWORK_socket_shutdown (ctx->s, SHUT_RDWR); 110 GNUNET_NETWORK_socket_shutdown (ctx->s, SHUT_RDWR);
115 } 111 }
@@ -146,10 +142,8 @@ try_send_tcp (uint32_t dst_ipv4, uint16_t dport, uint16_t data)
146#endif 142#endif
147 sa.sin_addr.s_addr = dst_ipv4; 143 sa.sin_addr.s_addr = dst_ipv4;
148 sa.sin_port = htons (dport); 144 sa.sin_port = htons (dport);
149#if DEBUG_NAT
150 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending TCP message to `%s'\n", 145 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending TCP message to `%s'\n",
151 GNUNET_a2s ((struct sockaddr *) &sa, sizeof (sa))); 146 GNUNET_a2s ((struct sockaddr *) &sa, sizeof (sa)));
152#endif
153 if ((GNUNET_OK != 147 if ((GNUNET_OK !=
154 GNUNET_NETWORK_socket_connect (s, (const struct sockaddr *) &sa, 148 GNUNET_NETWORK_socket_connect (s, (const struct sockaddr *) &sa,
155 sizeof (sa))) && (errno != EINPROGRESS)) 149 sizeof (sa))) && (errno != EINPROGRESS))
@@ -192,10 +186,8 @@ try_send_udp (uint32_t dst_ipv4, uint16_t dport, uint16_t data)
192#endif 186#endif
193 sa.sin_addr.s_addr = dst_ipv4; 187 sa.sin_addr.s_addr = dst_ipv4;
194 sa.sin_port = htons (dport); 188 sa.sin_port = htons (dport);
195#if DEBUG_NAT
196 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending UDP packet to `%s'\n", 189 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending UDP packet to `%s'\n",
197 GNUNET_a2s ((struct sockaddr *) &sa, sizeof (sa))); 190 GNUNET_a2s ((struct sockaddr *) &sa, sizeof (sa)));
198#endif
199 if (-1 == 191 if (-1 ==
200 GNUNET_NETWORK_socket_sendto (s, &data, sizeof (data), 192 GNUNET_NETWORK_socket_sendto (s, &data, sizeof (data),
201 (const struct sockaddr *) &sa, sizeof (sa))) 193 (const struct sockaddr *) &sa, sizeof (sa)))
@@ -219,9 +211,7 @@ test (void *cls, struct GNUNET_SERVER_Client *client,
219 const struct GNUNET_NAT_TestMessage *tm; 211 const struct GNUNET_NAT_TestMessage *tm;
220 uint16_t dport; 212 uint16_t dport;
221 213
222#if DEBUG_NAT
223 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received test request\n"); 214 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received test request\n");
224#endif
225 tm = (const struct GNUNET_NAT_TestMessage *) msg; 215 tm = (const struct GNUNET_NAT_TestMessage *) msg;
226 dport = ntohs (tm->dport); 216 dport = ntohs (tm->dport);
227 if (0 == dport) 217 if (0 == dport)
diff --git a/src/nat/nat.c b/src/nat/nat.c
index 53301ebb1..1b6556cbf 100644
--- a/src/nat/nat.c
+++ b/src/nat/nat.c
@@ -422,10 +422,8 @@ add_to_address_list_as_is (struct GNUNET_NAT_Handle *h,
422 lal->addrlen = arg_size; 422 lal->addrlen = arg_size;
423 lal->source = src; 423 lal->source = src;
424 GNUNET_CONTAINER_DLL_insert (h->lal_head, h->lal_tail, lal); 424 GNUNET_CONTAINER_DLL_insert (h->lal_head, h->lal_tail, lal);
425#if DEBUG_NAT
426 LOG (GNUNET_ERROR_TYPE_DEBUG, "Adding address `%s' from source %d\n", 425 LOG (GNUNET_ERROR_TYPE_DEBUG, "Adding address `%s' from source %d\n",
427 GNUNET_a2s (arg, arg_size), src); 426 GNUNET_a2s (arg, arg_size), src);
428#endif
429 if (NULL != h->address_callback) 427 if (NULL != h->address_callback)
430 h->address_callback (h->callback_cls, GNUNET_YES, arg, arg_size); 428 h->address_callback (h->callback_cls, GNUNET_YES, arg, arg_size);
431} 429}
@@ -750,10 +748,8 @@ nat_server_read (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
750 GNUNET_DISK_file_read (h->server_stdout_handle, mybuf, sizeof (mybuf)); 748 GNUNET_DISK_file_read (h->server_stdout_handle, mybuf, sizeof (mybuf));
751 if (bytes < 1) 749 if (bytes < 1)
752 { 750 {
753#if DEBUG_NAT
754 LOG (GNUNET_ERROR_TYPE_DEBUG, 751 LOG (GNUNET_ERROR_TYPE_DEBUG,
755 "Finished reading from server stdout with code: %d\n", bytes); 752 "Finished reading from server stdout with code: %d\n", bytes);
756#endif
757 if (0 != GNUNET_OS_process_kill (h->server_proc, SIGTERM)) 753 if (0 != GNUNET_OS_process_kill (h->server_proc, SIGTERM))
758 GNUNET_log_from_strerror (GNUNET_ERROR_TYPE_WARNING, "nat", "kill"); 754 GNUNET_log_from_strerror (GNUNET_ERROR_TYPE_WARNING, "nat", "kill");
759 GNUNET_OS_process_wait (h->server_proc); 755 GNUNET_OS_process_wait (h->server_proc);
@@ -809,10 +805,8 @@ nat_server_read (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
809 return; 805 return;
810 } 806 }
811 sin_addr.sin_port = htons ((uint16_t) port); 807 sin_addr.sin_port = htons ((uint16_t) port);
812#if DEBUG_NAT
813 LOG (GNUNET_ERROR_TYPE_DEBUG, "gnunet-helper-nat-server read: %s:%d\n", mybuf, 808 LOG (GNUNET_ERROR_TYPE_DEBUG, "gnunet-helper-nat-server read: %s:%d\n", mybuf,
814 port); 809 port);
815#endif
816 h->reversal_callback (h->callback_cls, (const struct sockaddr *) &sin_addr, 810 h->reversal_callback (h->callback_cls, (const struct sockaddr *) &sin_addr,
817 sizeof (sin_addr)); 811 sizeof (sin_addr));
818 h->server_read_task = 812 h->server_read_task =
@@ -837,10 +831,8 @@ start_gnunet_nat_server (struct GNUNET_NAT_Handle *h)
837 (h->server_stdout = 831 (h->server_stdout =
838 GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_NO, GNUNET_YES)))) 832 GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_NO, GNUNET_YES))))
839 { 833 {
840#if DEBUG_NAT
841 LOG (GNUNET_ERROR_TYPE_DEBUG, "Starting `%s' at `%s'\n", 834 LOG (GNUNET_ERROR_TYPE_DEBUG, "Starting `%s' at `%s'\n",
842 "gnunet-helper-nat-server", h->internal_address); 835 "gnunet-helper-nat-server", h->internal_address);
843#endif
844 /* Start the server process */ 836 /* Start the server process */
845 h->server_proc = 837 h->server_proc =
846 GNUNET_OS_start_process (GNUNET_NO, NULL, h->server_stdout, 838 GNUNET_OS_start_process (GNUNET_NO, NULL, h->server_stdout,
@@ -1079,11 +1071,9 @@ GNUNET_NAT_register (const struct GNUNET_CONFIGURATION_Handle *cfg, int is_tcp,
1079 struct in_addr in_addr; 1071 struct in_addr in_addr;
1080 unsigned int i; 1072 unsigned int i;
1081 1073
1082#if DEBUG_NAT
1083 LOG (GNUNET_ERROR_TYPE_DEBUG, 1074 LOG (GNUNET_ERROR_TYPE_DEBUG,
1084 "Registered with NAT service at port %u with %u IP bound local addresses\n", 1075 "Registered with NAT service at port %u with %u IP bound local addresses\n",
1085 (unsigned int) adv_port, num_addrs); 1076 (unsigned int) adv_port, num_addrs);
1086#endif
1087 h = GNUNET_malloc (sizeof (struct GNUNET_NAT_Handle)); 1077 h = GNUNET_malloc (sizeof (struct GNUNET_NAT_Handle));
1088 h->server_retry_delay = GNUNET_TIME_UNIT_SECONDS; 1078 h->server_retry_delay = GNUNET_TIME_UNIT_SECONDS;
1089 h->cfg = cfg; 1079 h->cfg = cfg;
@@ -1338,11 +1328,9 @@ GNUNET_NAT_run_client (struct GNUNET_NAT_Handle *h,
1338 return GNUNET_SYSERR; 1328 return GNUNET_SYSERR;
1339 } 1329 }
1340 GNUNET_snprintf (port_as_string, sizeof (port_as_string), "%d", h->adv_port); 1330 GNUNET_snprintf (port_as_string, sizeof (port_as_string), "%d", h->adv_port);
1341#if DEBUG_NAT
1342 LOG (GNUNET_ERROR_TYPE_DEBUG, 1331 LOG (GNUNET_ERROR_TYPE_DEBUG,
1343 _("Running gnunet-helper-nat-client %s %s %u\n"), h->internal_address, 1332 _("Running gnunet-helper-nat-client %s %s %u\n"), h->internal_address,
1344 inet4, (unsigned int) h->adv_port); 1333 inet4, (unsigned int) h->adv_port);
1345#endif
1346 proc = 1334 proc =
1347 GNUNET_OS_start_process (GNUNET_NO, 1335 GNUNET_OS_start_process (GNUNET_NO,
1348 NULL, NULL, "gnunet-helper-nat-client", 1336 NULL, NULL, "gnunet-helper-nat-client",
diff --git a/src/nat/nat.h b/src/nat/nat.h
index efab3a7a7..a0ef46593 100644
--- a/src/nat/nat.h
+++ b/src/nat/nat.h
@@ -28,7 +28,6 @@
28#define NAT_H 28#define NAT_H
29#include "gnunet_util_lib.h" 29#include "gnunet_util_lib.h"
30 30
31#define DEBUG_NAT GNUNET_EXTRA_LOGGING
32 31
33GNUNET_NETWORK_STRUCT_BEGIN 32GNUNET_NETWORK_STRUCT_BEGIN
34 33
diff --git a/src/nat/nat_mini.c b/src/nat/nat_mini.c
index 84cc84186..864a7f04e 100644
--- a/src/nat/nat_mini.c
+++ b/src/nat/nat_mini.c
@@ -524,9 +524,7 @@ process_unmap_output (void *cls, const char *line)
524 524
525 if (NULL == line) 525 if (NULL == line)
526 { 526 {
527#if DEBUG_NAT
528 LOG (GNUNET_ERROR_TYPE_DEBUG, "UPnP unmap done\n"); 527 LOG (GNUNET_ERROR_TYPE_DEBUG, "UPnP unmap done\n");
529#endif
530 GNUNET_OS_command_stop (mini->unmap_cmd); 528 GNUNET_OS_command_stop (mini->unmap_cmd);
531 mini->unmap_cmd = NULL; 529 mini->unmap_cmd = NULL;
532 GNUNET_free (mini); 530 GNUNET_free (mini);
@@ -577,10 +575,8 @@ GNUNET_NAT_mini_map_stop (struct GNUNET_NAT_MiniHandle *mini)
577 * often are the same, but it might... */ 575 * often are the same, but it might... */
578 GNUNET_snprintf (pstr, sizeof (pstr), "%u", 576 GNUNET_snprintf (pstr, sizeof (pstr), "%u",
579 (unsigned int) ntohs (mini->current_addr.sin_port)); 577 (unsigned int) ntohs (mini->current_addr.sin_port));
580#if DEBUG_NAT
581 LOG (GNUNET_ERROR_TYPE_DEBUG, "Unmapping port %u with UPnP\n", 578 LOG (GNUNET_ERROR_TYPE_DEBUG, "Unmapping port %u with UPnP\n",
582 ntohs (mini->current_addr.sin_port)); 579 ntohs (mini->current_addr.sin_port));
583#endif
584 mini->unmap_cmd = 580 mini->unmap_cmd =
585 GNUNET_OS_command_run (&process_unmap_output, mini, UNMAP_TIMEOUT, 581 GNUNET_OS_command_run (&process_unmap_output, mini, UNMAP_TIMEOUT,
586 "upnpc", "upnpc", "-d", pstr, 582 "upnpc", "upnpc", "-d", pstr,
diff --git a/src/nat/nat_test.c b/src/nat/nat_test.c
index 98ce82e73..5704d3484 100644
--- a/src/nat/nat_test.c
+++ b/src/nat/nat_test.c
@@ -180,10 +180,8 @@ reversal_cb (void *cls, const struct sockaddr *addr, socklen_t addrlen)
180 sa = (const struct sockaddr_in *) addr; 180 sa = (const struct sockaddr_in *) addr;
181 if (h->data != sa->sin_port) 181 if (h->data != sa->sin_port)
182 { 182 {
183#if DEBUG_NAT
184 LOG (GNUNET_ERROR_TYPE_DEBUG, 183 LOG (GNUNET_ERROR_TYPE_DEBUG,
185 "Received connection reversal request for wrong port\n"); 184 "Received connection reversal request for wrong port\n");
186#endif
187 return; /* wrong port */ 185 return; /* wrong port */
188 } 186 }
189 /* report success */ 187 /* report success */
@@ -214,17 +212,13 @@ do_udp_read (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
214 { 212 {
215 if (data == tst->data) 213 if (data == tst->data)
216 tst->report (tst->report_cls, GNUNET_OK); 214 tst->report (tst->report_cls, GNUNET_OK);
217#if DEBUG_NAT
218 else 215 else
219 LOG (GNUNET_ERROR_TYPE_DEBUG, 216 LOG (GNUNET_ERROR_TYPE_DEBUG,
220 "Received data mismatches expected value\n"); 217 "Received data mismatches expected value\n");
221#endif
222 } 218 }
223#if DEBUG_NAT
224 else 219 else
225 LOG (GNUNET_ERROR_TYPE_DEBUG, 220 LOG (GNUNET_ERROR_TYPE_DEBUG,
226 "Failed to receive data from inbound connection\n"); 221 "Failed to receive data from inbound connection\n");
227#endif
228} 222}
229 223
230 224
@@ -252,17 +246,13 @@ do_read (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
252 { 246 {
253 if (data == tst->data) 247 if (data == tst->data)
254 tst->report (tst->report_cls, GNUNET_OK); 248 tst->report (tst->report_cls, GNUNET_OK);
255#if DEBUG_NAT
256 else 249 else
257 LOG (GNUNET_ERROR_TYPE_DEBUG, 250 LOG (GNUNET_ERROR_TYPE_DEBUG,
258 "Received data mismatches expected value\n"); 251 "Received data mismatches expected value\n");
259#endif
260 } 252 }
261#if DEBUG_NAT
262 else 253 else
263 LOG (GNUNET_ERROR_TYPE_DEBUG, 254 LOG (GNUNET_ERROR_TYPE_DEBUG,
264 "Failed to receive data from inbound connection\n"); 255 "Failed to receive data from inbound connection\n");
265#endif
266 GNUNET_NETWORK_socket_close (na->sock); 256 GNUNET_NETWORK_socket_close (na->sock);
267 GNUNET_free (na); 257 GNUNET_free (na);
268} 258}
@@ -294,10 +284,8 @@ do_accept (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
294 GNUNET_log_strerror (GNUNET_ERROR_TYPE_INFO, "accept"); 284 GNUNET_log_strerror (GNUNET_ERROR_TYPE_INFO, "accept");
295 return; /* odd error */ 285 return; /* odd error */
296 } 286 }
297#if DEBUG_NAT
298 LOG (GNUNET_ERROR_TYPE_DEBUG, 287 LOG (GNUNET_ERROR_TYPE_DEBUG,
299 "Got an inbound connection, waiting for data\n"); 288 "Got an inbound connection, waiting for data\n");
300#endif
301 wl = GNUNET_malloc (sizeof (struct NatActivity)); 289 wl = GNUNET_malloc (sizeof (struct NatActivity));
302 wl->sock = s; 290 wl->sock = s;
303 wl->h = tst; 291 wl->h = tst;
@@ -331,10 +319,8 @@ addr_cb (void *cls, int add_remove, const struct sockaddr *addr,
331 return; 319 return;
332 if (addrlen != sizeof (struct sockaddr_in)) 320 if (addrlen != sizeof (struct sockaddr_in))
333 return; /* ignore IPv6 here */ 321 return; /* ignore IPv6 here */
334#if DEBUG_NAT
335 LOG (GNUNET_ERROR_TYPE_DEBUG, "Asking gnunet-nat-server to connect to `%s'\n", 322 LOG (GNUNET_ERROR_TYPE_DEBUG, "Asking gnunet-nat-server to connect to `%s'\n",
336 GNUNET_a2s (addr, addrlen)); 323 GNUNET_a2s (addr, addrlen));
337#endif
338 sa = (const struct sockaddr_in *) addr; 324 sa = (const struct sockaddr_in *) addr;
339 msg.header.size = htons (sizeof (struct GNUNET_NAT_TestMessage)); 325 msg.header.size = htons (sizeof (struct GNUNET_NAT_TestMessage));
340 msg.header.type = htons (GNUNET_MESSAGE_TYPE_NAT_TEST); 326 msg.header.type = htons (GNUNET_MESSAGE_TYPE_NAT_TEST);
diff --git a/src/nse/gnunet-service-nse.c b/src/nse/gnunet-service-nse.c
index 8aff436cb..8373b621c 100644
--- a/src/nse/gnunet-service-nse.c
+++ b/src/nse/gnunet-service-nse.c
@@ -410,9 +410,7 @@ handle_start_message (void *cls, struct GNUNET_SERVER_Client *client,
410{ 410{
411 struct GNUNET_NSE_ClientMessage em; 411 struct GNUNET_NSE_ClientMessage em;
412 412
413#if DEBUG_NSE
414 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received START message from client\n"); 413 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received START message from client\n");
415#endif
416 GNUNET_SERVER_notification_context_add (nc, client); 414 GNUNET_SERVER_notification_context_add (nc, client);
417 setup_estimate_message (&em); 415 setup_estimate_message (&em);
418 GNUNET_SERVER_notification_context_unicast (nc, client, &em.header, 416 GNUNET_SERVER_notification_context_unicast (nc, client, &em.header,
@@ -457,11 +455,9 @@ get_delay_randomization (uint32_t matching_bits)
457 455
458 d = get_matching_bits_delay (matching_bits); 456 d = get_matching_bits_delay (matching_bits);
459 i = (uint32_t) (d / (double) (hop_count_max + 1)); 457 i = (uint32_t) (d / (double) (hop_count_max + 1));
460#if DEBUG_NSE
461 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 458 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
462 "Randomizing flood using latencies up to %u ms\n", 459 "Randomizing flood using latencies up to %u ms\n",
463 (unsigned int) i); 460 (unsigned int) i);
464#endif
465 ret.rel_value = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, i + 1); 461 ret.rel_value = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, i + 1);
466 return ret; 462 return ret;
467#else 463#else
@@ -514,11 +510,9 @@ get_transmit_delay (int round_offset)
514#else 510#else
515 ret = GNUNET_TIME_UNIT_ZERO; 511 ret = GNUNET_TIME_UNIT_ZERO;
516#endif 512#endif
517#if DEBUG_NSE
518 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 513 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
519 "Transmitting previous round behind schedule in %llu ms\n", 514 "Transmitting previous round behind schedule in %llu ms\n",
520 (unsigned long long) ret.rel_value); 515 (unsigned long long) ret.rel_value);
521#endif
522 return ret; 516 return ret;
523 case 0: 517 case 0:
524 /* current round is based on best-known matching_bits */ 518 /* current round is based on best-known matching_bits */
@@ -527,13 +521,11 @@ get_transmit_delay (int round_offset)
527 dist_delay = get_matching_bits_delay (matching_bits); 521 dist_delay = get_matching_bits_delay (matching_bits);
528 dist_delay += get_delay_randomization (matching_bits).rel_value; 522 dist_delay += get_delay_randomization (matching_bits).rel_value;
529 ret.rel_value = (uint64_t) dist_delay; 523 ret.rel_value = (uint64_t) dist_delay;
530#if DEBUG_NSE
531 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 524 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
532 "For round %llu, delay for %u matching bits is %llu ms\n", 525 "For round %llu, delay for %u matching bits is %llu ms\n",
533 (unsigned long long) current_timestamp.abs_value, 526 (unsigned long long) current_timestamp.abs_value,
534 (unsigned int) matching_bits, 527 (unsigned int) matching_bits,
535 (unsigned long long) ret.rel_value); 528 (unsigned long long) ret.rel_value);
536#endif
537 /* now consider round start time and add delay to it */ 529 /* now consider round start time and add delay to it */
538 tgt = GNUNET_TIME_absolute_add (current_timestamp, ret); 530 tgt = GNUNET_TIME_absolute_add (current_timestamp, ret);
539 return GNUNET_TIME_absolute_get_remaining (tgt); 531 return GNUNET_TIME_absolute_get_remaining (tgt);
@@ -599,7 +591,6 @@ transmit_ready (void *cls, size_t size, void *buf)
599 1, GNUNET_NO); 591 1, GNUNET_NO);
600 return 0; 592 return 0;
601 } 593 }
602#if DEBUG_NSE
603 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 594 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
604 "In round %llu, sending to `%s' estimate with %u bits\n", 595 "In round %llu, sending to `%s' estimate with %u bits\n",
605 (unsigned long long) 596 (unsigned long long)
@@ -607,7 +598,6 @@ transmit_ready (void *cls, size_t size, void *buf)
607 timestamp).abs_value, 598 timestamp).abs_value,
608 GNUNET_i2s (&peer_entry->id), 599 GNUNET_i2s (&peer_entry->id),
609 (unsigned int) ntohl (size_estimate_messages[idx].matching_bits)); 600 (unsigned int) ntohl (size_estimate_messages[idx].matching_bits));
610#endif
611 if (ntohl (size_estimate_messages[idx].hop_count) == 0) 601 if (ntohl (size_estimate_messages[idx].hop_count) == 0)
612 GNUNET_STATISTICS_update (stats, "# flood messages started", 1, GNUNET_NO); 602 GNUNET_STATISTICS_update (stats, "# flood messages started", 1, GNUNET_NO);
613 GNUNET_STATISTICS_update (stats, "# flood messages transmitted", 1, 603 GNUNET_STATISTICS_update (stats, "# flood messages transmitted", 1,
@@ -887,10 +877,8 @@ find_proof (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
887 if (nse_work_required <= count_leading_zeroes (&result)) 877 if (nse_work_required <= count_leading_zeroes (&result))
888 { 878 {
889 my_proof = counter; 879 my_proof = counter;
890#if DEBUG_NSE
891 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Proof of work found: %llu!\n", 880 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Proof of work found: %llu!\n",
892 (unsigned long long) GNUNET_ntohll (counter)); 881 (unsigned long long) GNUNET_ntohll (counter));
893#endif
894 write_proof (); 882 write_proof ();
895 setup_flood_message (estimate_index, current_timestamp); 883 setup_flood_message (estimate_index, current_timestamp);
896 return; 884 return;
@@ -900,10 +888,8 @@ find_proof (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
900 } 888 }
901 if (my_proof / (100 * ROUND_SIZE) < counter / (100 * ROUND_SIZE)) 889 if (my_proof / (100 * ROUND_SIZE) < counter / (100 * ROUND_SIZE))
902 { 890 {
903#if DEBUG_NSE
904 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Testing proofs currently at %llu\n", 891 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Testing proofs currently at %llu\n",
905 (unsigned long long) counter); 892 (unsigned long long) counter);
906#endif
907 /* remember progress every 100 rounds */ 893 /* remember progress every 100 rounds */
908 my_proof = counter; 894 my_proof = counter;
909 write_proof (); 895 write_proof ();
@@ -1207,10 +1193,8 @@ handle_core_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
1207{ 1193{
1208 struct NSEPeerEntry *peer_entry; 1194 struct NSEPeerEntry *peer_entry;
1209 1195
1210#if DEBUG_NSE
1211 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer `%s' connected to us\n", 1196 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer `%s' connected to us\n",
1212 GNUNET_i2s (peer)); 1197 GNUNET_i2s (peer));
1213#endif
1214 peer_entry = GNUNET_malloc (sizeof (struct NSEPeerEntry)); 1198 peer_entry = GNUNET_malloc (sizeof (struct NSEPeerEntry));
1215 peer_entry->id = *peer; 1199 peer_entry->id = *peer;
1216 GNUNET_assert (GNUNET_OK == 1200 GNUNET_assert (GNUNET_OK ==
@@ -1236,10 +1220,8 @@ handle_core_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
1236{ 1220{
1237 struct NSEPeerEntry *pos; 1221 struct NSEPeerEntry *pos;
1238 1222
1239#if DEBUG_NSE
1240 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer `%s' disconnected from us\n", 1223 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer `%s' disconnected from us\n",
1241 GNUNET_i2s (peer)); 1224 GNUNET_i2s (peer));
1242#endif
1243 pos = GNUNET_CONTAINER_multihashmap_get (peers, &peer->hashPubKey); 1225 pos = GNUNET_CONTAINER_multihashmap_get (peers, &peer->hashPubKey);
1244 if (NULL == pos) 1226 if (NULL == pos)
1245 { 1227 {
diff --git a/src/nse/nse_api.c b/src/nse/nse_api.c
index 2fa8af2e5..9a44197c0 100644
--- a/src/nse/nse_api.c
+++ b/src/nse/nse_api.c
@@ -149,11 +149,9 @@ reschedule_connect (struct GNUNET_NSE_Handle *h)
149 h->client = NULL; 149 h->client = NULL;
150 } 150 }
151 151
152#if DEBUG_NSE
153 LOG (GNUNET_ERROR_TYPE_DEBUG, 152 LOG (GNUNET_ERROR_TYPE_DEBUG,
154 "Scheduling task to reconnect to nse service in %llu ms.\n", 153 "Scheduling task to reconnect to nse service in %llu ms.\n",
155 h->reconnect_delay.rel_value); 154 h->reconnect_delay.rel_value);
156#endif
157 h->reconnect_task = 155 h->reconnect_task =
158 GNUNET_SCHEDULER_add_delayed (h->reconnect_delay, &reconnect, h); 156 GNUNET_SCHEDULER_add_delayed (h->reconnect_delay, &reconnect, h);
159 if (h->reconnect_delay.rel_value == 0) 157 if (h->reconnect_delay.rel_value == 0)
@@ -187,16 +185,12 @@ send_start (void *cls, size_t size, void *buf)
187 if (buf == NULL) 185 if (buf == NULL)
188 { 186 {
189 /* Connect error... */ 187 /* Connect error... */
190#if DEBUG_NSE
191 LOG (GNUNET_ERROR_TYPE_DEBUG, 188 LOG (GNUNET_ERROR_TYPE_DEBUG,
192 "Shutdown while trying to transmit `%s' request.\n", "START"); 189 "Shutdown while trying to transmit `%s' request.\n", "START");
193#endif
194 reschedule_connect (h); 190 reschedule_connect (h);
195 return 0; 191 return 0;
196 } 192 }
197#if DEBUG_NSE
198 LOG (GNUNET_ERROR_TYPE_DEBUG, "Transmitting `%s' request.\n", "START"); 193 LOG (GNUNET_ERROR_TYPE_DEBUG, "Transmitting `%s' request.\n", "START");
199#endif
200 GNUNET_assert (size >= sizeof (struct GNUNET_MessageHeader)); 194 GNUNET_assert (size >= sizeof (struct GNUNET_MessageHeader));
201 195
202 msg = (struct GNUNET_MessageHeader *) buf; 196 msg = (struct GNUNET_MessageHeader *) buf;
@@ -225,10 +219,8 @@ reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
225 /* shutdown, just give up */ 219 /* shutdown, just give up */
226 return; 220 return;
227 } 221 }
228#if DEBUG_NSE
229 LOG (GNUNET_ERROR_TYPE_DEBUG, 222 LOG (GNUNET_ERROR_TYPE_DEBUG,
230 "Connecting to network size estimation service.\n"); 223 "Connecting to network size estimation service.\n");
231#endif
232 GNUNET_assert (h->client == NULL); 224 GNUNET_assert (h->client == NULL);
233 h->client = GNUNET_CLIENT_connect ("nse", h->cfg); 225 h->client = GNUNET_CLIENT_connect ("nse", h->cfg);
234 GNUNET_assert (h->client != NULL); 226 GNUNET_assert (h->client != NULL);
diff --git a/src/nse/test_nse_api.c b/src/nse/test_nse_api.c
index f6cde3fe4..658c8b9a5 100644
--- a/src/nse/test_nse_api.c
+++ b/src/nse/test_nse_api.c
@@ -29,8 +29,6 @@
29#include "gnunet_scheduler_lib.h" 29#include "gnunet_scheduler_lib.h"
30#include "gnunet_nse_service.h" 30#include "gnunet_nse_service.h"
31 31
32#define DEBUG_NSE GNUNET_YES
33
34#define START_ARM GNUNET_YES 32#define START_ARM GNUNET_YES
35 33
36static struct GNUNET_NSE_Handle *h; 34static struct GNUNET_NSE_Handle *h;
@@ -147,11 +145,7 @@ check ()
147 char *const argv[] = { "test-nse-api", 145 char *const argv[] = { "test-nse-api",
148 "-c", 146 "-c",
149 "test_nse.conf", 147 "test_nse.conf",
150#if DEBUG_NSE
151 "-L", "DEBUG",
152#else
153 "-L", "WARNING", 148 "-L", "WARNING",
154#endif
155 NULL 149 NULL
156 }; 150 };
157 struct GNUNET_GETOPT_CommandLineOption options[] = { 151 struct GNUNET_GETOPT_CommandLineOption options[] = {
@@ -173,14 +167,9 @@ main (int argc, char *argv[])
173 int ret; 167 int ret;
174 168
175 GNUNET_log_setup ("test_nse_api", 169 GNUNET_log_setup ("test_nse_api",
176#if DEBUG_NSE
177 "DEBUG",
178#else
179 "WARNING", 170 "WARNING",
180#endif
181 NULL); 171 NULL);
182 ret = check (); 172 ret = check ();
183
184 return ret; 173 return ret;
185} 174}
186 175
diff --git a/src/peerinfo/perf_peerinfo_api.c b/src/peerinfo/perf_peerinfo_api.c
index 1492e0789..8ad79b5b5 100755
--- a/src/peerinfo/perf_peerinfo_api.c
+++ b/src/peerinfo/perf_peerinfo_api.c
@@ -53,12 +53,11 @@ static int
53check_it (void *cls, const struct GNUNET_HELLO_Address *address, 53check_it (void *cls, const struct GNUNET_HELLO_Address *address,
54 struct GNUNET_TIME_Absolute expiration) 54 struct GNUNET_TIME_Absolute expiration)
55{ 55{
56#if DEBUG
57 if (addrlen > 0) 56 if (addrlen > 0)
58 { 57 {
59 FPRINTF (stderr, "name: %s, addr: %s\n", tname, (const char *) addr); 58 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
59 "name: %s, addr: %s\n", tname, (const char *) addr);
60 } 60 }
61#endif
62 return GNUNET_OK; 61 return GNUNET_OK;
63} 62}
64 63
@@ -107,17 +106,8 @@ static void
107process (void *cls, const struct GNUNET_PeerIdentity *peer, 106process (void *cls, const struct GNUNET_PeerIdentity *peer,
108 const struct GNUNET_HELLO_Message *hello, const char *err_msg) 107 const struct GNUNET_HELLO_Message *hello, const char *err_msg)
109{ 108{
110 if (peer == NULL) 109 if (NULL != peer)
111 { 110 {
112#if DEBUG
113 FPRINTF (stderr, "Process received NULL response\n");
114#endif
115 }
116 else
117 {
118#if DEBUG
119 FPRINTF (stderr, "Processed a peer\n");
120#endif
121 numpeers++; 111 numpeers++;
122 if (0 && (hello != NULL)) 112 if (0 && (hello != NULL))
123 GNUNET_HELLO_iterate_addresses (hello, GNUNET_NO, &check_it, NULL); 113 GNUNET_HELLO_iterate_addresses (hello, GNUNET_NO, &check_it, NULL);
@@ -153,11 +143,7 @@ check ()
153 char *const argv[] = { "perf-peerinfo-api", 143 char *const argv[] = { "perf-peerinfo-api",
154 "-c", 144 "-c",
155 "test_peerinfo_api_data.conf", 145 "test_peerinfo_api_data.conf",
156#if DEBUG_PEERINFO
157 "-L", "DEBUG",
158#else
159 "-L", "ERROR", 146 "-L", "ERROR",
160#endif
161 NULL 147 NULL
162 }; 148 };
163#if START_SERVICE 149#if START_SERVICE
@@ -169,11 +155,7 @@ check ()
169 proc = 155 proc =
170 GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-service-peerinfo", 156 GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-service-peerinfo",
171 "gnunet-service-peerinfo", 157 "gnunet-service-peerinfo",
172#if DEBUG_PEERINFO
173 "-L", "DEBUG",
174#else
175 "-L", "ERROR", 158 "-L", "ERROR",
176#endif
177 "-c", "test_peerinfo_api_data.conf", NULL); 159 "-c", "test_peerinfo_api_data.conf", NULL);
178#endif 160#endif
179 GNUNET_assert (NULL != proc); 161 GNUNET_assert (NULL != proc);
@@ -191,7 +173,6 @@ check ()
191 GNUNET_OS_process_wait (proc); 173 GNUNET_OS_process_wait (proc);
192 GNUNET_OS_process_close (proc); 174 GNUNET_OS_process_close (proc);
193 proc = NULL; 175 proc = NULL;
194
195#endif 176#endif
196 return ok; 177 return ok;
197} 178}
@@ -203,11 +184,7 @@ main (int argc, char *argv[])
203 int ret = 0; 184 int ret = 0;
204 185
205 GNUNET_log_setup ("perf_peerinfo_api", 186 GNUNET_log_setup ("perf_peerinfo_api",
206#if DEBUG_PEERINFO
207 "DEBUG",
208#else
209 "ERROR", 187 "ERROR",
210#endif
211 NULL); 188 NULL);
212 ret = check (); 189 ret = check ();
213 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-peerinfo"); 190 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-peerinfo");
diff --git a/src/peerinfo/test_peerinfo_api.c b/src/peerinfo/test_peerinfo_api.c
index e4eb7d480..ebb12b505 100644
--- a/src/peerinfo/test_peerinfo_api.c
+++ b/src/peerinfo/test_peerinfo_api.c
@@ -170,9 +170,6 @@ check ()
170 char *const argv[] = { "test-peerinfo-api", 170 char *const argv[] = { "test-peerinfo-api",
171 "-c", 171 "-c",
172 "test_peerinfo_api_data.conf", 172 "test_peerinfo_api_data.conf",
173#if DEBUG_PEERINFO
174 "-L", "DEBUG",
175#endif
176 NULL 173 NULL
177 }; 174 };
178 struct GNUNET_GETOPT_CommandLineOption options[] = { 175 struct GNUNET_GETOPT_CommandLineOption options[] = {
@@ -181,9 +178,6 @@ check ()
181 proc = 178 proc =
182 GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-service-peerinfo", 179 GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-service-peerinfo",
183 "gnunet-service-peerinfo", 180 "gnunet-service-peerinfo",
184#if DEBUG_PEERINFO
185 "-L", "DEBUG",
186#endif
187 "-c", "test_peerinfo_api_data.conf", NULL); 181 "-c", "test_peerinfo_api_data.conf", NULL);
188 GNUNET_assert (NULL != proc); 182 GNUNET_assert (NULL != proc);
189 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, 183 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv,
@@ -206,11 +200,7 @@ main (int argc, char *argv[])
206 int ret = 0; 200 int ret = 0;
207 201
208 GNUNET_log_setup ("test_peerinfo_api", 202 GNUNET_log_setup ("test_peerinfo_api",
209#if DEBUG_PEERINFO
210 "DEBUG",
211#else
212 "WARNING", 203 "WARNING",
213#endif
214 NULL); 204 NULL);
215 ret = check (); 205 ret = check ();
216 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-peerinfo"); 206 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-peerinfo");
diff --git a/src/statistics/test_statistics_api.c b/src/statistics/test_statistics_api.c
index 0647a4942..84d3f5a23 100644
--- a/src/statistics/test_statistics_api.c
+++ b/src/statistics/test_statistics_api.c
@@ -29,7 +29,6 @@
29#include "gnunet_scheduler_lib.h" 29#include "gnunet_scheduler_lib.h"
30#include "gnunet_statistics_service.h" 30#include "gnunet_statistics_service.h"
31 31
32#define DEBUG_STATISTICS GNUNET_EXTRA_LOGGING
33 32
34#define START_SERVICE GNUNET_YES 33#define START_SERVICE GNUNET_YES
35 34
@@ -130,11 +129,7 @@ check ()
130 char *const argv[] = { "test-statistics-api", 129 char *const argv[] = { "test-statistics-api",
131 "-c", 130 "-c",
132 "test_statistics_api_data.conf", 131 "test_statistics_api_data.conf",
133#if DEBUG_STATISTICS
134 "-L", "DEBUG",
135#else
136 "-L", "WARNING", 132 "-L", "WARNING",
137#endif
138 NULL 133 NULL
139 }; 134 };
140 struct GNUNET_GETOPT_CommandLineOption options[] = { 135 struct GNUNET_GETOPT_CommandLineOption options[] = {
@@ -146,9 +141,6 @@ check ()
146 proc = 141 proc =
147 GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-service-statistics", 142 GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-service-statistics",
148 "gnunet-service-statistics", 143 "gnunet-service-statistics",
149#if DEBUG_STATISTICS
150 "-L", "DEBUG",
151#endif
152 "-c", "test_statistics_api_data.conf", NULL); 144 "-c", "test_statistics_api_data.conf", NULL);
153#endif 145#endif
154 GNUNET_assert (NULL != proc); 146 GNUNET_assert (NULL != proc);
@@ -172,9 +164,6 @@ check ()
172 proc = 164 proc =
173 GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-service-statistics", 165 GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-service-statistics",
174 "gnunet-service-statistics", 166 "gnunet-service-statistics",
175#if DEBUG_STATISTICS
176 "-L", "DEBUG",
177#endif
178 "-c", "test_statistics_api_data.conf", NULL); 167 "-c", "test_statistics_api_data.conf", NULL);
179#endif 168#endif
180 GNUNET_PROGRAM_run (5, argv, "test-statistics-api", "nohelp", options, 169 GNUNET_PROGRAM_run (5, argv, "test-statistics-api", "nohelp", options,
@@ -198,11 +187,7 @@ main (int argc, char *argv[])
198 int ret; 187 int ret;
199 188
200 GNUNET_log_setup ("test_statistics_api", 189 GNUNET_log_setup ("test_statistics_api",
201#if DEBUG_STATISTICS
202 "DEBUG",
203#else
204 "WARNING", 190 "WARNING",
205#endif
206 NULL); 191 NULL);
207 ret = check (); 192 ret = check ();
208 193
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index bf43008bb..679d52937 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -230,32 +230,24 @@ plugin_env_receive_callback (void *cls, const struct GNUNET_PeerIdentity *peer,
230 if (NULL == message) 230 if (NULL == message)
231 goto end; 231 goto end;
232 type = ntohs (message->type); 232 type = ntohs (message->type);
233#if DEBUG_TRANSPORT
234
235 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received Message with type %u\n", type); 233 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received Message with type %u\n", type);
236#endif
237
238 switch (type) 234 switch (type)
239 { 235 {
240 case GNUNET_MESSAGE_TYPE_HELLO: 236 case GNUNET_MESSAGE_TYPE_HELLO:
241 GST_validation_handle_hello (message); 237 GST_validation_handle_hello (message);
242 return ret; 238 return ret;
243 case GNUNET_MESSAGE_TYPE_TRANSPORT_PING: 239 case GNUNET_MESSAGE_TYPE_TRANSPORT_PING:
244#if DEBUG_TRANSPORT
245 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK, 240 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK,
246 "Processing `%s' from `%s'\n", "PING", 241 "Processing `%s' from `%s'\n", "PING",
247 (sender_address != 242 (sender_address !=
248 NULL) ? GST_plugins_a2s (&address) : "<inbound>"); 243 NULL) ? GST_plugins_a2s (&address) : "<inbound>");
249#endif
250 GST_validation_handle_ping (peer, message, &address, session); 244 GST_validation_handle_ping (peer, message, &address, session);
251 break; 245 break;
252 case GNUNET_MESSAGE_TYPE_TRANSPORT_PONG: 246 case GNUNET_MESSAGE_TYPE_TRANSPORT_PONG:
253#if DEBUG_TRANSPORT
254 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK, 247 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK,
255 "Processing `%s' from `%s'\n", "PONG", 248 "Processing `%s' from `%s'\n", "PONG",
256 (sender_address != 249 (sender_address !=
257 NULL) ? GST_plugins_a2s (&address) : "<inbound>"); 250 NULL) ? GST_plugins_a2s (&address) : "<inbound>");
258#endif
259 GST_validation_handle_pong (peer, message); 251 GST_validation_handle_pong (peer, message);
260 break; 252 break;
261 case GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_CONNECT: 253 case GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_CONNECT:
@@ -290,11 +282,9 @@ end:
290 * this connections seem to go extra-slow */ 282 * this connections seem to go extra-slow */
291 GNUNET_ATS_address_update (GST_ats, &address, session, ats, ats_count); 283 GNUNET_ATS_address_update (GST_ats, &address, session, ats, ats_count);
292#endif 284#endif
293#if DEBUG_TRANSPORT
294 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 285 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
295 "Allowing receive from peer %s to continue in %llu ms\n", 286 "Allowing receive from peer %s to continue in %llu ms\n",
296 GNUNET_i2s (peer), (unsigned long long) ret.rel_value); 287 GNUNET_i2s (peer), (unsigned long long) ret.rel_value);
297#endif
298 return ret; 288 return ret;
299} 289}
300 290
@@ -346,10 +336,8 @@ plugin_env_session_end (void *cls, const struct GNUNET_PeerIdentity *peer,
346 struct GNUNET_HELLO_Address address; 336 struct GNUNET_HELLO_Address address;
347 337
348 GNUNET_assert (strlen (transport_name) > 0); 338 GNUNET_assert (strlen (transport_name) > 0);
349#if DEBUG_TRANSPORT
350 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Session %X to peer `%s' ended \n", 339 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Session %X to peer `%s' ended \n",
351 session, GNUNET_i2s (peer)); 340 session, GNUNET_i2s (peer));
352#endif
353 if (NULL != session) 341 if (NULL != session)
354 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK, 342 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK,
355 "transport-ats", 343 "transport-ats",
@@ -430,11 +418,9 @@ ats_request_address_change (void *cls,
430 /* ATS tells me to disconnect from peer */ 418 /* ATS tells me to disconnect from peer */
431 if ((bw_in == 0) && (bw_out == 0)) 419 if ((bw_in == 0) && (bw_out == 0))
432 { 420 {
433#if DEBUG_TRANSPORT
434 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 421 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
435 "ATS tells me to disconnect from peer `%s'\n", 422 "ATS tells me to disconnect from peer `%s'\n",
436 GNUNET_i2s (&address->peer)); 423 GNUNET_i2s (&address->peer));
437#endif
438 GST_neighbours_force_disconnect (&address->peer); 424 GST_neighbours_force_disconnect (&address->peer);
439 return; 425 return;
440 } 426 }
diff --git a/src/transport/gnunet-service-transport_hello.c b/src/transport/gnunet-service-transport_hello.c
index 3838c511a..870c083d2 100644
--- a/src/transport/gnunet-service-transport_hello.c
+++ b/src/transport/gnunet-service-transport_hello.c
@@ -166,13 +166,9 @@ refresh_hello_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
166 GNUNET_free (our_hello); 166 GNUNET_free (our_hello);
167 our_hello = GNUNET_HELLO_create (&GST_my_public_key, &address_generator, &gc); 167 our_hello = GNUNET_HELLO_create (&GST_my_public_key, &address_generator, &gc);
168 GNUNET_assert (NULL != our_hello); 168 GNUNET_assert (NULL != our_hello);
169
170#if DEBUG_TRANSPORT
171 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK, 169 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK,
172 "Refreshed my `%s', new size is %d\n", "HELLO", 170 "Refreshed my `%s', new size is %d\n", "HELLO",
173 GNUNET_HELLO_size (our_hello)); 171 GNUNET_HELLO_size (our_hello));
174#endif
175
176 GNUNET_STATISTICS_update (GST_stats, gettext_noop ("# refreshed my HELLO"), 1, 172 GNUNET_STATISTICS_update (GST_stats, gettext_noop ("# refreshed my HELLO"), 1,
177 GNUNET_NO); 173 GNUNET_NO);
178 if (NULL != hello_cb) 174 if (NULL != hello_cb)
@@ -260,13 +256,11 @@ GST_hello_modify_addresses (int addremove,
260{ 256{
261 struct OwnAddressList *al; 257 struct OwnAddressList *al;
262 258
263#if DEBUG_TRANSPORT
264 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 259 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
265 (add_remove == 260 (addremove ==
266 GNUNET_YES) ? "Adding `%s':%s to the set of our addresses\n" : 261 GNUNET_YES) ? "Adding `%s' to the set of our addresses\n" :
267 "Removing `%s':%s from the set of our addresses\n", 262 "Removing `%s' from the set of our addresses\n",
268 GST_plugins_a2s (address), p->short_name); 263 GST_plugins_a2s (address));
269#endif
270 GNUNET_assert (address != NULL); 264 GNUNET_assert (address != NULL);
271 if (GNUNET_NO == addremove) 265 if (GNUNET_NO == addremove)
272 { 266 {
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c
index efb0e4b77..00fe3bc4d 100644
--- a/src/transport/gnunet-service-transport_neighbours.c
+++ b/src/transport/gnunet-service-transport_neighbours.c
@@ -495,14 +495,10 @@ reset_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
495 n->state_reset = GNUNET_SCHEDULER_NO_TASK; 495 n->state_reset = GNUNET_SCHEDULER_NO_TASK;
496 if (n->state == S_CONNECTED) 496 if (n->state == S_CONNECTED)
497 return; 497 return;
498
499#if DEBUG_TRANSPORT
500 GNUNET_STATISTICS_update (GST_stats, 498 GNUNET_STATISTICS_update (GST_stats,
501 gettext_noop 499 gettext_noop
502 ("# failed connection attempts due to timeout"), 1, 500 ("# failed connection attempts due to timeout"), 1,
503 GNUNET_NO); 501 GNUNET_NO);
504#endif
505
506 /* resetting state */ 502 /* resetting state */
507 503
508 if (n->state == S_FAST_RECONNECT) 504 if (n->state == S_FAST_RECONNECT)
@@ -714,11 +710,9 @@ transmit_send_continuation (void *cls,
714 n->transmission_task = GNUNET_SCHEDULER_add_now (&transmission_task, n); 710 n->transmission_task = GNUNET_SCHEDULER_add_now (&transmission_task, n);
715 } 711 }
716 } 712 }
717#if DEBUG_TRANSPORT
718 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending message of type %u was %s\n", 713 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending message of type %u was %s\n",
719 ntohs (((struct GNUNET_MessageHeader *) mq->message_buf)->type), 714 ntohs (((struct GNUNET_MessageHeader *) mq->message_buf)->type),
720 (success == GNUNET_OK) ? "successful" : "FAILED"); 715 (success == GNUNET_OK) ? "successful" : "FAILED");
721#endif
722 if (NULL != mq->cont) 716 if (NULL != mq->cont)
723 mq->cont (mq->cont_cls, success); 717 mq->cont (mq->cont_cls, success);
724 GNUNET_free (mq); 718 GNUNET_free (mq);
@@ -763,10 +757,8 @@ try_transmission_to_peer (struct NeighbourMapEntry *n)
763 757
764 if (n->address == NULL) 758 if (n->address == NULL)
765 { 759 {
766#if DEBUG_TRANSPORT
767 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "No address for peer `%s'\n", 760 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "No address for peer `%s'\n",
768 GNUNET_i2s (&n->id)); 761 GNUNET_i2s (&n->id));
769#endif
770 GNUNET_CONTAINER_DLL_remove (n->messages_head, n->messages_tail, mq); 762 GNUNET_CONTAINER_DLL_remove (n->messages_head, n->messages_tail, mq);
771 transmit_send_continuation (mq, &n->id, GNUNET_SYSERR); 763 transmit_send_continuation (mq, &n->id, GNUNET_SYSERR);
772 GNUNET_assert (n->transmission_task == GNUNET_SCHEDULER_NO_TASK); 764 GNUNET_assert (n->transmission_task == GNUNET_SCHEDULER_NO_TASK);
@@ -853,11 +845,9 @@ static void
853send_disconnect_cont (void *cls, const struct GNUNET_PeerIdentity *target, 845send_disconnect_cont (void *cls, const struct GNUNET_PeerIdentity *target,
854 int result) 846 int result)
855{ 847{
856#if DEBUG_TRANSPORT
857 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 848 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
858 "Sending DISCONNECT message to peer `%4s': %i\n", 849 "Sending DISCONNECT message to peer `%4s': %i\n",
859 GNUNET_i2s (target), result); 850 GNUNET_i2s (target), result);
860#endif
861} 851}
862 852
863 853
@@ -867,12 +857,9 @@ send_disconnect (struct NeighbourMapEntry * n)
867 size_t ret; 857 size_t ret;
868 struct SessionDisconnectMessage disconnect_msg; 858 struct SessionDisconnectMessage disconnect_msg;
869 859
870#if DEBUG_TRANSPORT
871 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 860 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
872 "Sending DISCONNECT message to peer `%4s'\n", 861 "Sending DISCONNECT message to peer `%4s'\n",
873 GNUNET_i2s (&n->id)); 862 GNUNET_i2s (&n->id));
874#endif
875
876 disconnect_msg.header.size = htons (sizeof (struct SessionDisconnectMessage)); 863 disconnect_msg.header.size = htons (sizeof (struct SessionDisconnectMessage));
877 disconnect_msg.header.type = 864 disconnect_msg.header.type =
878 htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_DISCONNECT); 865 htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_DISCONNECT);
@@ -1112,10 +1099,8 @@ disconnect_all_neighbours (void *cls, const GNUNET_HashCode * key, void *value)
1112{ 1099{
1113 struct NeighbourMapEntry *n = value; 1100 struct NeighbourMapEntry *n = value;
1114 1101
1115#if DEBUG_TRANSPORT
1116 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting peer `%4s', %s\n", 1102 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting peer `%4s', %s\n",
1117 GNUNET_i2s (&n->id), "SHUTDOWN_TASK"); 1103 GNUNET_i2s (&n->id), "SHUTDOWN_TASK");
1118#endif
1119 if (S_CONNECTED == n->state) 1104 if (S_CONNECTED == n->state)
1120 GNUNET_STATISTICS_update (GST_stats, 1105 GNUNET_STATISTICS_update (GST_stats,
1121 gettext_noop 1106 gettext_noop
@@ -1180,11 +1165,9 @@ send_outbound_quota (const struct GNUNET_PeerIdentity *target,
1180{ 1165{
1181 struct QuotaSetMessage q_msg; 1166 struct QuotaSetMessage q_msg;
1182 1167
1183#if DEBUG_TRANSPORT
1184 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1168 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1185 "Sending outbound quota of %u Bps for peer `%s' to all clients\n", 1169 "Sending outbound quota of %u Bps for peer `%s' to all clients\n",
1186 ntohl (quota.value__), GNUNET_i2s (target)); 1170 ntohl (quota.value__), GNUNET_i2s (target));
1187#endif
1188 q_msg.header.size = htons (sizeof (struct QuotaSetMessage)); 1171 q_msg.header.size = htons (sizeof (struct QuotaSetMessage));
1189 q_msg.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA); 1172 q_msg.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA);
1190 q_msg.quota = quota; 1173 q_msg.quota = quota;
@@ -1232,11 +1215,9 @@ send_connect_continuation (void *cls, const struct GNUNET_PeerIdentity *target,
1232 if ((GNUNET_NO == success) && 1215 if ((GNUNET_NO == success) &&
1233 ((n->state == S_NOT_CONNECTED) || (n->state == S_CONNECT_SENT))) 1216 ((n->state == S_NOT_CONNECTED) || (n->state == S_CONNECT_SENT)))
1234 { 1217 {
1235#if DEBUG_TRANSPORT
1236 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1218 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1237 "Failed to send CONNECT_MSG to peer `%4s' with address '%s' session %p, asking ATS for new address \n", 1219 "Failed to send CONNECT_MSG to peer `%4s' with address '%s' session %p, asking ATS for new address \n",
1238 GNUNET_i2s (&n->id), GST_plugins_a2s (n->address), n->session); 1220 GNUNET_i2s (&n->id), GST_plugins_a2s (n->address), n->session);
1239#endif
1240 change_state (n, S_NOT_CONNECTED); 1221 change_state (n, S_NOT_CONNECTED);
1241 if (n->ats_suggest != GNUNET_SCHEDULER_NO_TASK) 1222 if (n->ats_suggest != GNUNET_SCHEDULER_NO_TASK)
1242 GNUNET_SCHEDULER_cancel (n->ats_suggest); 1223 GNUNET_SCHEDULER_cancel (n->ats_suggest);
@@ -1350,11 +1331,9 @@ send_switch_address_continuation (void *cls,
1350 } 1331 }
1351 break; 1332 break;
1352 case S_FAST_RECONNECT: 1333 case S_FAST_RECONNECT:
1353#if DEBUG_TRANSPORT
1354 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1334 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1355 "Successful fast reconnect to peer `%s'\n", 1335 "Successful fast reconnect to peer `%s'\n",
1356 GNUNET_i2s (&n->id)); 1336 GNUNET_i2s (&n->id));
1357#endif
1358 change_state (n, S_CONNECTED); 1337 change_state (n, S_CONNECTED);
1359 neighbours_connected++; 1338 neighbours_connected++;
1360 GNUNET_STATISTICS_set (GST_stats, gettext_noop ("# peers connected"), neighbours_connected, 1339 GNUNET_STATISTICS_set (GST_stats, gettext_noop ("# peers connected"), neighbours_connected,
@@ -1424,11 +1403,9 @@ send_connect_ack_continuation (void *cls,
1424 } 1403 }
1425 1404
1426 /* sending failed, ask for next address */ 1405 /* sending failed, ask for next address */
1427#if DEBUG_TRANSPORT
1428 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1406 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1429 "Failed to send CONNECT_MSG to peer `%4s' with address '%s' session %X, asking ATS for new address \n", 1407 "Failed to send CONNECT_MSG to peer `%4s' with address '%s' session %X, asking ATS for new address \n",
1430 GNUNET_i2s (&n->id), GST_plugins_a2s (n->address), n->session); 1408 GNUNET_i2s (&n->id), GST_plugins_a2s (n->address), n->session);
1431#endif
1432 if (n->state != S_NOT_CONNECTED) 1409 if (n->state != S_NOT_CONNECTED)
1433 change_state (n, S_NOT_CONNECTED); 1410 change_state (n, S_NOT_CONNECTED);
1434 GNUNET_assert (strlen (cc->address->transport_name) > 0); 1411 GNUNET_assert (strlen (cc->address->transport_name) > 0);
@@ -1763,10 +1740,8 @@ setup_neighbour (const struct GNUNET_PeerIdentity *peer)
1763{ 1740{
1764 struct NeighbourMapEntry *n; 1741 struct NeighbourMapEntry *n;
1765 1742
1766#if DEBUG_TRANSPORT
1767 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1743 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1768 "Unknown peer `%s', creating new neighbour\n", GNUNET_i2s (peer)); 1744 "Unknown peer `%s', creating new neighbour\n", GNUNET_i2s (peer));
1769#endif
1770 n = GNUNET_malloc (sizeof (struct NeighbourMapEntry)); 1745 n = GNUNET_malloc (sizeof (struct NeighbourMapEntry));
1771 n->id = *peer; 1746 n->id = *peer;
1772 n->state = S_NOT_CONNECTED; 1747 n->state = S_NOT_CONNECTED;
@@ -1800,10 +1775,8 @@ GST_neighbours_try_connect (const struct GNUNET_PeerIdentity *target)
1800 { 1775 {
1801 return; 1776 return;
1802 } 1777 }
1803#if DEBUG_TRANSPORT
1804 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Trying to connect to peer `%s'\n", 1778 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Trying to connect to peer `%s'\n",
1805 GNUNET_i2s (target)); 1779 GNUNET_i2s (target));
1806#endif
1807 if (0 == 1780 if (0 ==
1808 memcmp (target, &GST_my_identity, sizeof (struct GNUNET_PeerIdentity))) 1781 memcmp (target, &GST_my_identity, sizeof (struct GNUNET_PeerIdentity)))
1809 { 1782 {
@@ -1823,12 +1796,9 @@ GST_neighbours_try_connect (const struct GNUNET_PeerIdentity *target)
1823 1796
1824 if (n == NULL) 1797 if (n == NULL)
1825 n = setup_neighbour (target); 1798 n = setup_neighbour (target);
1826#if DEBUG_TRANSPORT
1827 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1799 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1828 "Asking ATS for suggested address to connect to peer `%s'\n", 1800 "Asking ATS for suggested address to connect to peer `%s'\n",
1829 GNUNET_i2s (&n->id)); 1801 GNUNET_i2s (&n->id));
1830#endif
1831
1832 GNUNET_ATS_suggest_address (GST_ats, &n->id); 1802 GNUNET_ATS_suggest_address (GST_ats, &n->id);
1833} 1803}
1834 1804
@@ -1873,12 +1843,8 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer,
1873 /* This can happen during shutdown */ 1843 /* This can happen during shutdown */
1874 return; 1844 return;
1875 } 1845 }
1876
1877#if DEBUG_TRANSPORT
1878 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Session %X to peer `%s' ended \n", 1846 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Session %X to peer `%s' ended \n",
1879 session, GNUNET_i2s (peer)); 1847 session, GNUNET_i2s (peer));
1880#endif
1881
1882 n = lookup_neighbour (peer); 1848 n = lookup_neighbour (peer);
1883 if (NULL == n) 1849 if (NULL == n)
1884 return; 1850 return;
@@ -1974,7 +1940,6 @@ GST_neighbours_send (const struct GNUNET_PeerIdentity *target, const void *msg,
1974 gettext_noop 1940 gettext_noop
1975 ("# messages not sent (no such peer or not connected)"), 1941 ("# messages not sent (no such peer or not connected)"),
1976 1, GNUNET_NO); 1942 1, GNUNET_NO);
1977#if DEBUG_TRANSPORT
1978 if (n == NULL) 1943 if (n == NULL)
1979 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1944 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1980 "Could not send message to peer `%s': unknown neighbour", 1945 "Could not send message to peer `%s': unknown neighbour",
@@ -1983,7 +1948,6 @@ GST_neighbours_send (const struct GNUNET_PeerIdentity *target, const void *msg,
1983 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1948 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1984 "Could not send message to peer `%s': not connected\n", 1949 "Could not send message to peer `%s': not connected\n",
1985 GNUNET_i2s (target)); 1950 GNUNET_i2s (target));
1986#endif
1987 if (NULL != cont) 1951 if (NULL != cont)
1988 cont (cont_cls, GNUNET_SYSERR); 1952 cont (cont_cls, GNUNET_SYSERR);
1989 return; 1953 return;
@@ -1995,12 +1959,9 @@ GST_neighbours_send (const struct GNUNET_PeerIdentity *target, const void *msg,
1995 gettext_noop 1959 gettext_noop
1996 ("# messages not sent (no such peer or not connected)"), 1960 ("# messages not sent (no such peer or not connected)"),
1997 1, GNUNET_NO); 1961 1, GNUNET_NO);
1998#if DEBUG_TRANSPORT
1999 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1962 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2000 "Could not send message to peer `%s': no address available\n", 1963 "Could not send message to peer `%s': no address available\n",
2001 GNUNET_i2s (target)); 1964 GNUNET_i2s (target));
2002#endif
2003
2004 if (NULL != cont) 1965 if (NULL != cont)
2005 cont (cont_cls, GNUNET_SYSERR); 1966 cont (cont_cls, GNUNET_SYSERR);
2006 return; 1967 return;
@@ -2075,12 +2036,10 @@ GST_neighbours_calculate_receive_delay (const struct GNUNET_PeerIdentity
2075 if (GNUNET_YES == GNUNET_BANDWIDTH_tracker_consume (&n->in_tracker, size)) 2036 if (GNUNET_YES == GNUNET_BANDWIDTH_tracker_consume (&n->in_tracker, size))
2076 { 2037 {
2077 n->quota_violation_count++; 2038 n->quota_violation_count++;
2078#if DEBUG_TRANSPORT
2079 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2039 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2080 "Bandwidth quota (%u b/s) violation detected (total of %u).\n", 2040 "Bandwidth quota (%u b/s) violation detected (total of %u).\n",
2081 n->in_tracker.available_bytes_per_s__, 2041 n->in_tracker.available_bytes_per_s__,
2082 n->quota_violation_count); 2042 n->quota_violation_count);
2083#endif
2084 /* Discount 32k per violation */ 2043 /* Discount 32k per violation */
2085 GNUNET_BANDWIDTH_tracker_consume (&n->in_tracker, -32 * 1024); 2044 GNUNET_BANDWIDTH_tracker_consume (&n->in_tracker, -32 * 1024);
2086 } 2045 }
@@ -2106,14 +2065,12 @@ GST_neighbours_calculate_receive_delay (const struct GNUNET_PeerIdentity
2106 ret = GNUNET_BANDWIDTH_tracker_get_delay (&n->in_tracker, 32 * 1024); 2065 ret = GNUNET_BANDWIDTH_tracker_get_delay (&n->in_tracker, 32 * 1024);
2107 if (ret.rel_value > 0) 2066 if (ret.rel_value > 0)
2108 { 2067 {
2109#if DEBUG_TRANSPORT
2110 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2068 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2111 "Throttling read (%llu bytes excess at %u b/s), waiting %llu ms before reading more.\n", 2069 "Throttling read (%llu bytes excess at %u b/s), waiting %llu ms before reading more.\n",
2112 (unsigned long long) n->in_tracker. 2070 (unsigned long long) n->in_tracker.
2113 consumption_since_last_update__, 2071 consumption_since_last_update__,
2114 (unsigned int) n->in_tracker.available_bytes_per_s__, 2072 (unsigned int) n->in_tracker.available_bytes_per_s__,
2115 (unsigned long long) ret.rel_value); 2073 (unsigned long long) ret.rel_value);
2116#endif
2117 GNUNET_STATISTICS_update (GST_stats, 2074 GNUNET_STATISTICS_update (GST_stats,
2118 gettext_noop ("# ms throttling suggested"), 2075 gettext_noop ("# ms throttling suggested"),
2119 (int64_t) ret.rel_value, GNUNET_NO); 2076 (int64_t) ret.rel_value, GNUNET_NO);
@@ -2216,11 +2173,8 @@ GST_neighbours_keepalive_response (const struct GNUNET_PeerIdentity *neighbour,
2216 n->latency = 2173 n->latency =
2217 GNUNET_TIME_absolute_get_difference (n->keep_alive_sent, 2174 GNUNET_TIME_absolute_get_difference (n->keep_alive_sent,
2218 GNUNET_TIME_absolute_get ()); 2175 GNUNET_TIME_absolute_get ());
2219#if DEBUG_TRANSPORT
2220 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Latency for peer `%s' is %llu ms\n", 2176 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Latency for peer `%s' is %llu ms\n",
2221 GNUNET_i2s (&n->id), n->latency.rel_value); 2177 GNUNET_i2s (&n->id), n->latency.rel_value);
2222#endif
2223
2224 2178
2225 if (n->latency.rel_value == GNUNET_TIME_relative_get_forever ().rel_value) 2179 if (n->latency.rel_value == GNUNET_TIME_relative_get_forever ().rel_value)
2226 { 2180 {
@@ -2275,18 +2229,14 @@ GST_neighbours_set_incoming_quota (const struct GNUNET_PeerIdentity *neighbour,
2275 1, GNUNET_NO); 2229 1, GNUNET_NO);
2276 return; 2230 return;
2277 } 2231 }
2278#if DEBUG_TRANSPORT
2279 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2232 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2280 "Setting inbound quota of %u Bps for peer `%s' to all clients\n", 2233 "Setting inbound quota of %u Bps for peer `%s' to all clients\n",
2281 ntohl (quota.value__), GNUNET_i2s (&n->id)); 2234 ntohl (quota.value__), GNUNET_i2s (&n->id));
2282#endif
2283 GNUNET_BANDWIDTH_tracker_update_quota (&n->in_tracker, quota); 2235 GNUNET_BANDWIDTH_tracker_update_quota (&n->in_tracker, quota);
2284 if (0 != ntohl (quota.value__)) 2236 if (0 != ntohl (quota.value__))
2285 return; 2237 return;
2286#if DEBUG_TRANSPORT
2287 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting peer `%4s' due to `%s'\n", 2238 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting peer `%4s' due to `%s'\n",
2288 GNUNET_i2s (&n->id), "SET_QUOTA"); 2239 GNUNET_i2s (&n->id), "SET_QUOTA");
2289#endif
2290 if (is_connected (n)) 2240 if (is_connected (n))
2291 GNUNET_STATISTICS_update (GST_stats, 2241 GNUNET_STATISTICS_update (GST_stats,
2292 gettext_noop ("# disconnects due to quota of 0"), 2242 gettext_noop ("# disconnects due to quota of 0"),
@@ -2396,12 +2346,9 @@ GST_neighbours_handle_disconnect_message (const struct GNUNET_PeerIdentity
2396 const struct SessionDisconnectMessage *sdm; 2346 const struct SessionDisconnectMessage *sdm;
2397 GNUNET_HashCode hc; 2347 GNUNET_HashCode hc;
2398 2348
2399#if DEBUG_TRANSPORT
2400 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2349 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2401 "Received DISCONNECT message from peer `%s'\n", 2350 "Received DISCONNECT message from peer `%s'\n",
2402 GNUNET_i2s (peer)); 2351 GNUNET_i2s (peer));
2403#endif
2404
2405 if (ntohs (msg->size) != sizeof (struct SessionDisconnectMessage)) 2352 if (ntohs (msg->size) != sizeof (struct SessionDisconnectMessage))
2406 { 2353 {
2407 // GNUNET_break_op (0); 2354 // GNUNET_break_op (0);
@@ -2585,12 +2532,10 @@ GST_neighbours_handle_connect_ack (const struct GNUNET_MessageHeader *message,
2585 neighbours_connected++; 2532 neighbours_connected++;
2586 GNUNET_STATISTICS_set (GST_stats, gettext_noop ("# peers connected"), neighbours_connected, 2533 GNUNET_STATISTICS_set (GST_stats, gettext_noop ("# peers connected"), neighbours_connected,
2587 GNUNET_NO); 2534 GNUNET_NO);
2588#if DEBUG_TRANSPORT
2589 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2535 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2590 "Notify about connect of `%4s' using address '%s' session %X LINE %u\n", 2536 "Notify about connect of `%4s' using address '%s' session %X LINE %u\n",
2591 GNUNET_i2s (&n->id), GST_plugins_a2s (n->address), n->session, 2537 GNUNET_i2s (&n->id), GST_plugins_a2s (n->address), n->session,
2592 __LINE__); 2538 __LINE__);
2593#endif
2594 connect_notify_cb (callback_cls, &n->id, ats, ats_count); 2539 connect_notify_cb (callback_cls, &n->id, ats, ats_count);
2595 send_outbound_quota (peer, n->bandwidth_out); 2540 send_outbound_quota (peer, n->bandwidth_out);
2596 2541
@@ -2607,11 +2552,8 @@ GST_neighbours_handle_ack (const struct GNUNET_MessageHeader *message,
2607{ 2552{
2608 struct NeighbourMapEntry *n; 2553 struct NeighbourMapEntry *n;
2609 2554
2610#if DEBUG_TRANSPORT
2611 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received ACK message from peer `%s'\n", 2555 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received ACK message from peer `%s'\n",
2612 GNUNET_i2s (peer)); 2556 GNUNET_i2s (peer));
2613#endif
2614
2615 if (ntohs (message->size) != sizeof (struct GNUNET_MessageHeader)) 2557 if (ntohs (message->size) != sizeof (struct GNUNET_MessageHeader))
2616 { 2558 {
2617 GNUNET_break_op (0); 2559 GNUNET_break_op (0);
@@ -2656,12 +2598,10 @@ GST_neighbours_handle_ack (const struct GNUNET_MessageHeader *message,
2656 GST_neighbours_set_incoming_quota (&n->id, n->bandwidth_in); 2598 GST_neighbours_set_incoming_quota (&n->id, n->bandwidth_in);
2657 if (n->keepalive_task == GNUNET_SCHEDULER_NO_TASK) 2599 if (n->keepalive_task == GNUNET_SCHEDULER_NO_TASK)
2658 n->keepalive_task = GNUNET_SCHEDULER_add_now (&neighbour_keepalive_task, n); 2600 n->keepalive_task = GNUNET_SCHEDULER_add_now (&neighbour_keepalive_task, n);
2659#if DEBUG_TRANSPORT
2660 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2601 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2661 "Notify about connect of `%4s' using address '%s' session %X LINE %u\n", 2602 "Notify about connect of `%4s' using address '%s' session %X LINE %u\n",
2662 GNUNET_i2s (&n->id), GST_plugins_a2s (n->address), n->session, 2603 GNUNET_i2s (&n->id), GST_plugins_a2s (n->address), n->session,
2663 __LINE__); 2604 __LINE__);
2664#endif
2665 connect_notify_cb (callback_cls, &n->id, ats, ats_count); 2605 connect_notify_cb (callback_cls, &n->id, ats, ats_count);
2666 send_outbound_quota (peer, n->bandwidth_out); 2606 send_outbound_quota (peer, n->bandwidth_out);
2667} 2607}
@@ -2688,13 +2628,10 @@ handle_connect_blacklist_cont (void *cls,
2688 struct NeighbourMapEntry *n; 2628 struct NeighbourMapEntry *n;
2689 struct BlackListCheckContext *bcc = cls; 2629 struct BlackListCheckContext *bcc = cls;
2690 2630
2691#if DEBUG_TRANSPORT
2692 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2631 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2693 "Blacklist check due to CONNECT message: `%s'\n", 2632 "Blacklist check due to CONNECT message: `%s'\n",
2694 GNUNET_i2s (peer), 2633 GNUNET_i2s (peer),
2695 (result == GNUNET_OK) ? "ALLOWED" : "FORBIDDEN"); 2634 (result == GNUNET_OK) ? "ALLOWED" : "FORBIDDEN");
2696#endif
2697
2698 /* not allowed */ 2635 /* not allowed */
2699 if (GNUNET_OK != result) 2636 if (GNUNET_OK != result)
2700 { 2637 {
@@ -2762,11 +2699,8 @@ GST_neighbours_handle_connect (const struct GNUNET_MessageHeader *message,
2762 struct BlackListCheckContext *bcc = NULL; 2699 struct BlackListCheckContext *bcc = NULL;
2763 struct NeighbourMapEntry *n; 2700 struct NeighbourMapEntry *n;
2764 2701
2765#if DEBUG_TRANSPORT
2766 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2702 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2767 "Received CONNECT message from peer `%s'\n", GNUNET_i2s (peer)); 2703 "Received CONNECT message from peer `%s'\n", GNUNET_i2s (peer));
2768#endif
2769
2770 if (ntohs (message->size) != sizeof (struct SessionConnectMessage)) 2704 if (ntohs (message->size) != sizeof (struct SessionConnectMessage))
2771 { 2705 {
2772 GNUNET_break_op (0); 2706 GNUNET_break_op (0);
diff --git a/src/transport/gnunet-service-transport_validation.c b/src/transport/gnunet-service-transport_validation.c
index 75ff4eb6f..ff786079f 100644
--- a/src/transport/gnunet-service-transport_validation.c
+++ b/src/transport/gnunet-service-transport_validation.c
@@ -870,10 +870,8 @@ GST_validation_handle_ping (const struct GNUNET_PeerIdentity *sender,
870 PONG_SIGNATURE_LIFETIME.rel_value / 4) 870 PONG_SIGNATURE_LIFETIME.rel_value / 4)
871 { 871 {
872 /* create / update cached sig */ 872 /* create / update cached sig */
873#if DEBUG_TRANSPORT
874 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 873 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
875 "Creating PONG signature to indicate ownership.\n"); 874 "Creating PONG signature to indicate ownership.\n");
876#endif
877 *sig_cache_exp = GNUNET_TIME_relative_to_absolute (PONG_SIGNATURE_LIFETIME); 875 *sig_cache_exp = GNUNET_TIME_relative_to_absolute (PONG_SIGNATURE_LIFETIME);
878 pong->expiration = GNUNET_TIME_absolute_hton (*sig_cache_exp); 876 pong->expiration = GNUNET_TIME_absolute_hton (*sig_cache_exp);
879 GNUNET_assert (GNUNET_OK == 877 GNUNET_assert (GNUNET_OK ==
@@ -1083,13 +1081,9 @@ GST_validation_handle_pong (const struct GNUNET_PeerIdentity *sender,
1083 GNUNET_NO); 1081 GNUNET_NO);
1084 return; 1082 return;
1085 } 1083 }
1086#if DEBUG_TRANSPORT
1087 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1084 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1088 "Address validated for peer `%s' with plugin `%s': `%s'\n", 1085 "Address validated for peer `%s' with plugin `%s': `%s'\n",
1089 GNUNET_i2s (sender), tname, GST_plugins_a2s (tname, addr, 1086 GNUNET_i2s (sender), tname, GST_plugins_a2s (&address));
1090 addrlen));
1091#endif
1092
1093 /* validity achieved, remember it! */ 1087 /* validity achieved, remember it! */
1094 ve->expecting_pong = GNUNET_NO; 1088 ve->expecting_pong = GNUNET_NO;
1095 ve->valid_until = GNUNET_TIME_relative_to_absolute (HELLO_ADDRESS_EXPIRATION); 1089 ve->valid_until = GNUNET_TIME_relative_to_absolute (HELLO_ADDRESS_EXPIRATION);
diff --git a/src/transport/plugin_transport_http.c b/src/transport/plugin_transport_http.c
index 48db6a372..4f9279495 100644
--- a/src/transport/plugin_transport_http.c
+++ b/src/transport/plugin_transport_http.c
@@ -786,23 +786,17 @@ http_plugin_send (void *cls,
786 786
787 if (session->inbound == GNUNET_NO) 787 if (session->inbound == GNUNET_NO)
788 { 788 {
789#if DEBUG_HTTP
790 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, 789 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
791 "Using outbound client session %p to send to `%s'\n", session, 790 "Using outbound client session %p to send to `%s'\n", session,
792 GNUNET_i2s (&session->target)); 791 GNUNET_i2s (&session->target));
793#endif
794
795 client_send (session, msg); 792 client_send (session, msg);
796 res = msgbuf_size; 793 res = msgbuf_size;
797 } 794 }
798 if (session->inbound == GNUNET_YES) 795 if (session->inbound == GNUNET_YES)
799 { 796 {
800#if DEBUG_HTTP
801 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, 797 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
802 "Using inbound server %p session to send to `%s'\n", session, 798 "Using inbound server %p session to send to `%s'\n", session,
803 GNUNET_i2s (&session->target)); 799 GNUNET_i2s (&session->target));
804#endif
805
806 server_send (session, msg); 800 server_send (session, msg);
807 res = msgbuf_size; 801 res = msgbuf_size;
808 } 802 }
@@ -1556,11 +1550,8 @@ LIBGNUNET_PLUGIN_TRANSPORT_INIT (void *cls)
1556 /* Report addresses to transport service */ 1550 /* Report addresses to transport service */
1557 start_report_addresses (plugin); 1551 start_report_addresses (plugin);
1558 1552
1559#if DEBUG_HTTP
1560 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, 1553 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
1561 "Plugin `%s' loaded\n", plugin->name); 1554 "Plugin `%s' loaded\n", plugin->name);
1562#endif
1563
1564 return api; 1555 return api;
1565} 1556}
1566 1557
@@ -1588,10 +1579,8 @@ LIBGNUNET_PLUGIN_TRANSPORT_DONE (void *cls)
1588 s = plugin->head; 1579 s = plugin->head;
1589 while (s != NULL) 1580 while (s != NULL)
1590 { 1581 {
1591#if DEBUG_HTTP
1592 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, 1582 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
1593 "Disconnecting `%s' \n", GNUNET_i2s (&s->target)); 1583 "Disconnecting `%s' \n", GNUNET_i2s (&s->target));
1594#endif
1595 if (s->inbound == GNUNET_NO) 1584 if (s->inbound == GNUNET_NO)
1596 GNUNET_assert (GNUNET_OK == client_disconnect (s)); 1585 GNUNET_assert (GNUNET_OK == client_disconnect (s));
1597 else 1586 else
@@ -1599,15 +1588,11 @@ LIBGNUNET_PLUGIN_TRANSPORT_DONE (void *cls)
1599 s = s->next; 1588 s = s->next;
1600 } 1589 }
1601 1590
1602#if DEBUG_HTTP
1603 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, "Stopping server\n"); 1591 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, "Stopping server\n");
1604#endif
1605 /* Stop server */ 1592 /* Stop server */
1606 server_stop (plugin); 1593 server_stop (plugin);
1607 1594
1608#if DEBUG_HTTP
1609 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, "Stopping client\n"); 1595 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, "Stopping client\n");
1610#endif
1611 /* Stop client */ 1596 /* Stop client */
1612 client_stop (plugin); 1597 client_stop (plugin);
1613 1598
@@ -1639,17 +1624,12 @@ LIBGNUNET_PLUGIN_TRANSPORT_DONE (void *cls)
1639 s = t; 1624 s = t;
1640 } 1625 }
1641 1626
1642
1643#if DEBUG_HTTP
1644 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, 1627 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
1645 "Plugin `%s' unloaded\n", plugin->name); 1628 "Plugin `%s' unloaded\n", plugin->name);
1646#endif
1647
1648 GNUNET_free_non_null (plugin->server_addr_v4); 1629 GNUNET_free_non_null (plugin->server_addr_v4);
1649 GNUNET_free_non_null (plugin->server_addr_v6); 1630 GNUNET_free_non_null (plugin->server_addr_v6);
1650 GNUNET_free (plugin); 1631 GNUNET_free (plugin);
1651 GNUNET_free (api); 1632 GNUNET_free (api);
1652
1653 return NULL; 1633 return NULL;
1654} 1634}
1655 1635
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c
index 0a6e0c52c..96b465291 100644
--- a/src/transport/plugin_transport_http_server.c
+++ b/src/transport/plugin_transport_http_server.c
@@ -229,10 +229,7 @@ server_load_certificate (struct Plugin *plugin)
229 } 229 }
230 GNUNET_free (key_file); 230 GNUNET_free (key_file);
231 GNUNET_free (cert_file); 231 GNUNET_free (cert_file);
232#if DEBUG_HTTP
233 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "TLS certificate loaded\n"); 232 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "TLS certificate loaded\n");
234#endif
235
236 return res; 233 return res;
237} 234}
238#endif 235#endif
@@ -1168,13 +1165,9 @@ server_start (struct Plugin *plugin)
1168 return GNUNET_SYSERR; 1165 return GNUNET_SYSERR;
1169 } 1166 }
1170 server_reschedule (plugin, plugin->server_v6, GNUNET_NO); 1167 server_reschedule (plugin, plugin->server_v6, GNUNET_NO);
1171
1172
1173#if DEBUG_HTTP
1174 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, 1168 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
1175 "%s server component started on port %u\n", plugin->name, 1169 "%s server component started on port %u\n", plugin->name,
1176 plugin->port); 1170 plugin->port);
1177#endif
1178 return res; 1171 return res;
1179} 1172}
1180 1173
@@ -1249,10 +1242,8 @@ server_stop (struct Plugin *plugin)
1249 GNUNET_free_non_null (plugin->key); 1242 GNUNET_free_non_null (plugin->key);
1250#endif 1243#endif
1251 1244
1252#if DEBUG_HTTP
1253 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, 1245 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
1254 "%s server component stopped\n", plugin->name); 1246 "%s server component stopped\n", plugin->name);
1255#endif
1256} 1247}
1257 1248
1258 1249
diff --git a/src/transport/plugin_transport_udp_broadcasting.c b/src/transport/plugin_transport_udp_broadcasting.c
index d378f2663..623cde2bd 100644
--- a/src/transport/plugin_transport_udp_broadcasting.c
+++ b/src/transport/plugin_transport_udp_broadcasting.c
@@ -105,12 +105,10 @@ broadcast_ipv6_mst_cb (void *cls, void *client,
105 if (GNUNET_MESSAGE_TYPE_TRANSPORT_BROADCAST_BEACON != 105 if (GNUNET_MESSAGE_TYPE_TRANSPORT_BROADCAST_BEACON !=
106 ntohs (msg->header.type)) 106 ntohs (msg->header.type))
107 return; 107 return;
108#if DEBUG_UDP_BROADCASTING
109 LOG (GNUNET_ERROR_TYPE_DEBUG, 108 LOG (GNUNET_ERROR_TYPE_DEBUG,
110 "Received beacon with %u bytes from peer `%s' via address `%s'\n", 109 "Received beacon with %u bytes from peer `%s' via address `%s'\n",
111 ntohs (msg->header.size), GNUNET_i2s (&msg->sender), 110 ntohs (msg->header.size), GNUNET_i2s (&msg->sender),
112 udp_address_to_string (NULL, &mc->addr, sizeof (mc->addr))); 111 udp_address_to_string (NULL, &mc->addr, sizeof (mc->addr)));
113#endif
114 struct GNUNET_ATS_Information atsi[2]; 112 struct GNUNET_ATS_Information atsi[2];
115 113
116 /* setup ATS */ 114 /* setup ATS */
@@ -146,12 +144,10 @@ broadcast_ipv4_mst_cb (void *cls, void *client,
146 if (GNUNET_MESSAGE_TYPE_TRANSPORT_BROADCAST_BEACON != 144 if (GNUNET_MESSAGE_TYPE_TRANSPORT_BROADCAST_BEACON !=
147 ntohs (msg->header.type)) 145 ntohs (msg->header.type))
148 return; 146 return;
149#if DEBUG_UDP_BROADCASTING
150 LOG (GNUNET_ERROR_TYPE_DEBUG, 147 LOG (GNUNET_ERROR_TYPE_DEBUG,
151 "Received beacon with %u bytes from peer `%s' via address `%s'\n", 148 "Received beacon with %u bytes from peer `%s' via address `%s'\n",
152 ntohs (msg->header.size), GNUNET_i2s (&msg->sender), 149 ntohs (msg->header.size), GNUNET_i2s (&msg->sender),
153 udp_address_to_string (NULL, &mc->addr, sizeof (mc->addr))); 150 udp_address_to_string (NULL, &mc->addr, sizeof (mc->addr)));
154#endif
155 151
156 struct GNUNET_ATS_Information atsi[2]; 152 struct GNUNET_ATS_Information atsi[2];
157 153
@@ -181,11 +177,9 @@ udp_broadcast_receive (struct Plugin *plugin, const char * buf, ssize_t size, st
181 177
182 if (addrlen == sizeof (struct sockaddr_in)) 178 if (addrlen == sizeof (struct sockaddr_in))
183 { 179 {
184#if DEBUG_UDP_BROADCASTING
185 LOG (GNUNET_ERROR_TYPE_DEBUG, 180 LOG (GNUNET_ERROR_TYPE_DEBUG,
186 "Received IPv4 HELLO beacon broadcast with %i bytes from address %s\n", 181 "Received IPv4 HELLO beacon broadcast with %i bytes from address %s\n",
187 size, GNUNET_a2s ((const struct sockaddr *) addr, addrlen)); 182 size, GNUNET_a2s ((const struct sockaddr *) addr, addrlen));
188#endif
189 struct Mstv4Context *mc; 183 struct Mstv4Context *mc;
190 184
191 mc = GNUNET_malloc (sizeof (struct Mstv4Context)); 185 mc = GNUNET_malloc (sizeof (struct Mstv4Context));
@@ -202,11 +196,9 @@ udp_broadcast_receive (struct Plugin *plugin, const char * buf, ssize_t size, st
202 } 196 }
203 else if (addrlen == sizeof (struct sockaddr_in6)) 197 else if (addrlen == sizeof (struct sockaddr_in6))
204 { 198 {
205#if DEBUG_UDP_BROADCASTING
206 LOG (GNUNET_ERROR_TYPE_DEBUG, 199 LOG (GNUNET_ERROR_TYPE_DEBUG,
207 "Received IPv6 HELLO beacon broadcast with %i bytes from address %s\n", 200 "Received IPv6 HELLO beacon broadcast with %i bytes from address %s\n",
208 size, GNUNET_a2s ((const struct sockaddr *) &addr, addrlen)); 201 size, GNUNET_a2s ((const struct sockaddr *) &addr, addrlen));
209#endif
210 struct Mstv6Context *mc; 202 struct Mstv6Context *mc;
211 203
212 mc = GNUNET_malloc (sizeof (struct Mstv6Context)); 204 mc = GNUNET_malloc (sizeof (struct Mstv6Context));
@@ -329,7 +321,6 @@ iface_proc (void *cls, const char *name, int isDefault,
329 321
330 if (addr != NULL) 322 if (addr != NULL)
331 { 323 {
332#if DEBUG_UDP_BROADCASTING
333 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "address %s for interface %s %p\n ", 324 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "address %s for interface %s %p\n ",
334 GNUNET_a2s (addr, addrlen), name, addr); 325 GNUNET_a2s (addr, addrlen), name, addr);
335 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 326 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -337,7 +328,6 @@ iface_proc (void *cls, const char *name, int isDefault,
337 GNUNET_a2s (broadcast_addr, addrlen), name, broadcast_addr); 328 GNUNET_a2s (broadcast_addr, addrlen), name, broadcast_addr);
338 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "netmask %s for interface %s %p\n ", 329 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "netmask %s for interface %s %p\n ",
339 GNUNET_a2s (netmask, addrlen), name, netmask); 330 GNUNET_a2s (netmask, addrlen), name, netmask);
340#endif
341 331
342 /* Collecting broadcast addresses */ 332 /* Collecting broadcast addresses */
343 if (broadcast_addr != NULL) 333 if (broadcast_addr != NULL)
@@ -430,9 +420,7 @@ setup_broadcast (struct Plugin *plugin, struct sockaddr_in6 *serverAddrv6, struc
430 } 420 }
431 else 421 else
432 { 422 {
433#if DEBUG_UDP
434 LOG (GNUNET_ERROR_TYPE_DEBUG, "IPv6 broadcasting running\n"); 423 LOG (GNUNET_ERROR_TYPE_DEBUG, "IPv6 broadcasting running\n");
435#endif
436 plugin->send_ipv6_broadcast_task = 424 plugin->send_ipv6_broadcast_task =
437 GNUNET_SCHEDULER_add_now (&udp_ipv6_broadcast_send, plugin); 425 GNUNET_SCHEDULER_add_now (&udp_ipv6_broadcast_send, plugin);
438 plugin->broadcast_ipv6 = GNUNET_YES; 426 plugin->broadcast_ipv6 = GNUNET_YES;
@@ -483,9 +471,7 @@ stop_broadcast (struct Plugin *plugin)
483 } 471 }
484 else 472 else
485 { 473 {
486#if DEBUG_UDP
487 LOG (GNUNET_ERROR_TYPE_DEBUG, "IPv6 Broadcasting stopped\n"); 474 LOG (GNUNET_ERROR_TYPE_DEBUG, "IPv6 Broadcasting stopped\n");
488#endif
489 } 475 }
490 476
491 if (plugin->send_ipv6_broadcast_task != GNUNET_SCHEDULER_NO_TASK) 477 if (plugin->send_ipv6_broadcast_task != GNUNET_SCHEDULER_NO_TASK)
diff --git a/src/transport/transport.h b/src/transport/transport.h
index 027720271..e0b881970 100644
--- a/src/transport/transport.h
+++ b/src/transport/transport.h
@@ -33,11 +33,6 @@
33 33
34#define DEBUG_TRANSPORT GNUNET_EXTRA_LOGGING 34#define DEBUG_TRANSPORT GNUNET_EXTRA_LOGGING
35 35
36#define DEBUG_TRANSPORT_TIMEOUT GNUNET_EXTRA_LOGGING
37
38#define DEBUG_TRANSPORT_DISCONNECT GNUNET_EXTRA_LOGGING
39
40#define DEBUG_TRANSPORT_API GNUNET_EXTRA_LOGGING
41 36
42/** 37/**
43 * For how long do we allow unused bandwidth 38 * For how long do we allow unused bandwidth
diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c
index e7f2327d9..b97a24596 100644
--- a/src/transport/transport_api.c
+++ b/src/transport/transport_api.c
@@ -342,10 +342,8 @@ neighbour_add (struct GNUNET_TRANSPORT_Handle *h,
342{ 342{
343 struct Neighbour *n; 343 struct Neighbour *n;
344 344
345#if DEBUG_TRANSPORT_API
346 LOG (GNUNET_ERROR_TYPE_DEBUG, "Creating entry for neighbour `%4s'.\n", 345 LOG (GNUNET_ERROR_TYPE_DEBUG, "Creating entry for neighbour `%4s'.\n",
347 GNUNET_i2s (pid)); 346 GNUNET_i2s (pid));
348#endif
349 n = GNUNET_malloc (sizeof (struct Neighbour)); 347 n = GNUNET_malloc (sizeof (struct Neighbour));
350 n->id = *pid; 348 n->id = *pid;
351 n->h = h; 349 n->h = h;
@@ -416,10 +414,8 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg)
416 GNUNET_assert (h->client != NULL); 414 GNUNET_assert (h->client != NULL);
417 if (msg == NULL) 415 if (msg == NULL)
418 { 416 {
419#if DEBUG_TRANSPORT_API 417 LOG (GNUNET_ERROR_TYPE_DEBUG,
420 LOG (GNUNET_ERROR_TYPE_INFO,
421 "Error receiving from transport service, disconnecting temporarily.\n"); 418 "Error receiving from transport service, disconnecting temporarily.\n");
422#endif
423 disconnect_and_schedule_reconnect (h); 419 disconnect_and_schedule_reconnect (h);
424 return; 420 return;
425 } 421 }
@@ -435,11 +431,9 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg)
435 GNUNET_break (0); 431 GNUNET_break (0);
436 break; 432 break;
437 } 433 }
438#if DEBUG_TRANSPORT_API
439 LOG (GNUNET_ERROR_TYPE_DEBUG, 434 LOG (GNUNET_ERROR_TYPE_DEBUG,
440 "Receiving (my own) `%s' message, I am `%4s'.\n", "HELLO", 435 "Receiving (my own) `%s' message, I am `%4s'.\n", "HELLO",
441 GNUNET_i2s (&me)); 436 GNUNET_i2s (&me));
442#endif
443 GNUNET_free_non_null (h->my_hello); 437 GNUNET_free_non_null (h->my_hello);
444 h->my_hello = NULL; 438 h->my_hello = NULL;
445 if (size < sizeof (struct GNUNET_MessageHeader)) 439 if (size < sizeof (struct GNUNET_MessageHeader))
@@ -474,10 +468,8 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg)
474 break; 468 break;
475 } 469 }
476 ats = (const struct GNUNET_ATS_Information *) &cim[1]; 470 ats = (const struct GNUNET_ATS_Information *) &cim[1];
477#if DEBUG_TRANSPORT_API
478 LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message for `%4s'.\n", 471 LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message for `%4s'.\n",
479 "CONNECT", GNUNET_i2s (&cim->id)); 472 "CONNECT", GNUNET_i2s (&cim->id));
480#endif
481 n = neighbour_find (h, &cim->id); 473 n = neighbour_find (h, &cim->id);
482 if (n != NULL) 474 if (n != NULL)
483 { 475 {
@@ -496,10 +488,8 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg)
496 } 488 }
497 dim = (const struct DisconnectInfoMessage *) msg; 489 dim = (const struct DisconnectInfoMessage *) msg;
498 GNUNET_break (ntohl (dim->reserved) == 0); 490 GNUNET_break (ntohl (dim->reserved) == 0);
499#if DEBUG_TRANSPORT_API_DISCONNECT
500 LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message for `%4s'.\n", 491 LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message for `%4s'.\n",
501 "DISCONNECT", GNUNET_i2s (&dim->peer)); 492 "DISCONNECT", GNUNET_i2s (&dim->peer));
502#endif
503 n = neighbour_find (h, &dim->peer); 493 n = neighbour_find (h, &dim->peer);
504 if (n == NULL) 494 if (n == NULL)
505 { 495 {
@@ -515,10 +505,8 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg)
515 break; 505 break;
516 } 506 }
517 okm = (const struct SendOkMessage *) msg; 507 okm = (const struct SendOkMessage *) msg;
518#if DEBUG_TRANSPORT_API
519 LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message, transmission %s.\n", 508 LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message, transmission %s.\n",
520 "SEND_OK", ntohl (okm->success) == GNUNET_OK ? "succeeded" : "failed"); 509 "SEND_OK", ntohl (okm->success) == GNUNET_OK ? "succeeded" : "failed");
521#endif
522 n = neighbour_find (h, &okm->peer); 510 n = neighbour_find (h, &okm->peer);
523 if (n == NULL) 511 if (n == NULL)
524 break; 512 break;
@@ -536,9 +524,7 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg)
536 } 524 }
537 break; 525 break;
538 case GNUNET_MESSAGE_TYPE_TRANSPORT_RECV: 526 case GNUNET_MESSAGE_TYPE_TRANSPORT_RECV:
539#if DEBUG_TRANSPORT_API
540 LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message.\n", "RECV"); 527 LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message.\n", "RECV");
541#endif
542 if (size < 528 if (size <
543 sizeof (struct InboundMessage) + sizeof (struct GNUNET_MessageHeader)) 529 sizeof (struct InboundMessage) + sizeof (struct GNUNET_MessageHeader))
544 { 530 {
@@ -555,10 +541,8 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg)
555 GNUNET_break (0); 541 GNUNET_break (0);
556 break; 542 break;
557 } 543 }
558#if DEBUG_TRANSPORT_API
559 LOG (GNUNET_ERROR_TYPE_DEBUG, "Received message of type %u from `%4s'.\n", 544 LOG (GNUNET_ERROR_TYPE_DEBUG, "Received message of type %u from `%4s'.\n",
560 ntohs (imm->type), GNUNET_i2s (&im->peer)); 545 ntohs (imm->type), GNUNET_i2s (&im->peer));
561#endif
562 n = neighbour_find (h, &im->peer); 546 n = neighbour_find (h, &im->peer);
563 if (n == NULL) 547 if (n == NULL)
564 { 548 {
@@ -569,9 +553,7 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg)
569 h->rec (h->cls, &im->peer, imm, ats, ats_count); 553 h->rec (h->cls, &im->peer, imm, ats, ats_count);
570 break; 554 break;
571 case GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA: 555 case GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA:
572#if DEBUG_TRANSPORT_API
573 LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message.\n", "SET_QUOTA"); 556 LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message.\n", "SET_QUOTA");
574#endif
575 if (size != sizeof (struct QuotaSetMessage)) 557 if (size != sizeof (struct QuotaSetMessage))
576 { 558 {
577 GNUNET_break (0); 559 GNUNET_break (0);
@@ -653,10 +635,8 @@ transport_notify_ready (void *cls, size_t size, void *buf)
653 { 635 {
654 GNUNET_CONTAINER_DLL_remove (h->control_head, h->control_tail, th); 636 GNUNET_CONTAINER_DLL_remove (h->control_head, h->control_tail, th);
655 nret = th->notify (th->notify_cls, size, &cbuf[ret]); 637 nret = th->notify (th->notify_cls, size, &cbuf[ret]);
656#if DEBUG_TRANSPORT_API
657 LOG (GNUNET_ERROR_TYPE_DEBUG, "Added %u bytes of control message at %u\n", 638 LOG (GNUNET_ERROR_TYPE_DEBUG, "Added %u bytes of control message at %u\n",
658 nret, ret); 639 nret, ret);
659#endif
660 GNUNET_free (th); 640 GNUNET_free (th);
661 ret += nret; 641 ret += nret;
662 size -= nret; 642 size -= nret;
@@ -714,10 +694,8 @@ transport_notify_ready (void *cls, size_t size, void *buf)
714 } 694 }
715 /* if there are more pending messages, try to schedule those */ 695 /* if there are more pending messages, try to schedule those */
716 schedule_transmission (h); 696 schedule_transmission (h);
717#if DEBUG_TRANSPORT_API
718 LOG (GNUNET_ERROR_TYPE_DEBUG, "Transmitting %u bytes to transport service\n", 697 LOG (GNUNET_ERROR_TYPE_DEBUG, "Transmitting %u bytes to transport service\n",
719 ret); 698 ret);
720#endif
721 return ret; 699 return ret;
722} 700}
723 701
@@ -750,11 +728,9 @@ schedule_transmission_task (void *cls,
750 n->th = NULL; 728 n->th = NULL;
751 GNUNET_assert (n == GNUNET_CONTAINER_heap_remove_root (h->ready_heap)); 729 GNUNET_assert (n == GNUNET_CONTAINER_heap_remove_root (h->ready_heap));
752 n->hn = NULL; 730 n->hn = NULL;
753#if DEBUG_TRANSPORT_API
754 LOG (GNUNET_ERROR_TYPE_DEBUG, 731 LOG (GNUNET_ERROR_TYPE_DEBUG,
755 "Signalling timeout for transmission to peer %s due to congestion\n", 732 "Signalling timeout for transmission to peer %s due to congestion\n",
756 GNUNET_i2s (&n->id)); 733 GNUNET_i2s (&n->id));
757#endif
758 GNUNET_assert (0 == th->notify (th->notify_cls, 0, NULL)); 734 GNUNET_assert (0 == th->notify (th->notify_cls, 0, NULL));
759 GNUNET_free (th); 735 GNUNET_free (th);
760 } 736 }
@@ -771,9 +747,7 @@ schedule_transmission_task (void *cls,
771 return; /* no pending messages */ 747 return; /* no pending messages */
772 size = n->th->notify_size + sizeof (struct OutboundMessage); 748 size = n->th->notify_size + sizeof (struct OutboundMessage);
773 } 749 }
774#if DEBUG_TRANSPORT_API
775 LOG (GNUNET_ERROR_TYPE_DEBUG, "Calling notify_transmit_ready\n"); 750 LOG (GNUNET_ERROR_TYPE_DEBUG, "Calling notify_transmit_ready\n");
776#endif
777 h->cth = 751 h->cth =
778 GNUNET_CLIENT_notify_transmit_ready (h->client, size, 752 GNUNET_CLIENT_notify_transmit_ready (h->client, size,
779 GNUNET_TIME_UNIT_FOREVER_REL, 753 GNUNET_TIME_UNIT_FOREVER_REL,
@@ -809,11 +783,9 @@ schedule_transmission (struct GNUNET_TRANSPORT_Handle *h)
809 n->th->notify_size); 783 n->th->notify_size);
810 else 784 else
811 return; /* no work to be done */ 785 return; /* no work to be done */
812#if DEBUG_TRANSPORT_API
813 LOG (GNUNET_ERROR_TYPE_DEBUG, 786 LOG (GNUNET_ERROR_TYPE_DEBUG,
814 "Scheduling next transmission to service in %llu ms\n", 787 "Scheduling next transmission to service in %llu ms\n",
815 (unsigned long long) delay.rel_value); 788 (unsigned long long) delay.rel_value);
816#endif
817 h->quota_task = 789 h->quota_task =
818 GNUNET_SCHEDULER_add_delayed (delay, &schedule_transmission_task, h); 790 GNUNET_SCHEDULER_add_delayed (delay, &schedule_transmission_task, h);
819} 791}
@@ -835,10 +807,8 @@ schedule_control_transmit (struct GNUNET_TRANSPORT_Handle *h, size_t size,
835{ 807{
836 struct GNUNET_TRANSPORT_TransmitHandle *th; 808 struct GNUNET_TRANSPORT_TransmitHandle *th;
837 809
838#if DEBUG_TRANSPORT_API
839 LOG (GNUNET_ERROR_TYPE_DEBUG, "Control transmit of %u bytes requested\n", 810 LOG (GNUNET_ERROR_TYPE_DEBUG, "Control transmit of %u bytes requested\n",
840 size); 811 size);
841#endif
842 th = GNUNET_malloc (sizeof (struct GNUNET_TRANSPORT_TransmitHandle)); 812 th = GNUNET_malloc (sizeof (struct GNUNET_TRANSPORT_TransmitHandle));
843 th->notify = notify; 813 th->notify = notify;
844 th->notify_cls = notify_cls; 814 th->notify_cls = notify_cls;
@@ -866,15 +836,11 @@ send_start (void *cls, size_t size, void *buf)
866 if (buf == NULL) 836 if (buf == NULL)
867 { 837 {
868 /* Can only be shutdown, just give up */ 838 /* Can only be shutdown, just give up */
869#if DEBUG_TRANSPORT_API
870 LOG (GNUNET_ERROR_TYPE_DEBUG, 839 LOG (GNUNET_ERROR_TYPE_DEBUG,
871 "Shutdown while trying to transmit `%s' request.\n", "START"); 840 "Shutdown while trying to transmit `%s' request.\n", "START");
872#endif
873 return 0; 841 return 0;
874 } 842 }
875#if DEBUG_TRANSPORT_API
876 LOG (GNUNET_ERROR_TYPE_DEBUG, "Transmitting `%s' request.\n", "START"); 843 LOG (GNUNET_ERROR_TYPE_DEBUG, "Transmitting `%s' request.\n", "START");
877#endif
878 GNUNET_assert (size >= sizeof (struct StartMessage)); 844 GNUNET_assert (size >= sizeof (struct StartMessage));
879 s.header.size = htons (sizeof (struct StartMessage)); 845 s.header.size = htons (sizeof (struct StartMessage));
880 s.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_START); 846 s.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_START);
@@ -909,9 +875,7 @@ reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
909 /* shutdown, just give up */ 875 /* shutdown, just give up */
910 return; 876 return;
911 } 877 }
912#if DEBUG_TRANSPORT_API
913 LOG (GNUNET_ERROR_TYPE_DEBUG, "Connecting to transport service.\n"); 878 LOG (GNUNET_ERROR_TYPE_DEBUG, "Connecting to transport service.\n");
914#endif
915 GNUNET_assert (h->client == NULL); 879 GNUNET_assert (h->client == NULL);
916 GNUNET_assert (h->control_head == NULL); 880 GNUNET_assert (h->control_head == NULL);
917 GNUNET_assert (h->control_tail == NULL); 881 GNUNET_assert (h->control_tail == NULL);
@@ -956,11 +920,9 @@ disconnect_and_schedule_reconnect (struct GNUNET_TRANSPORT_Handle *h)
956 th->notify (th->notify_cls, 0, NULL); 920 th->notify (th->notify_cls, 0, NULL);
957 GNUNET_free (th); 921 GNUNET_free (th);
958 } 922 }
959#if DEBUG_TRANSPORT_API
960 LOG (GNUNET_ERROR_TYPE_DEBUG, 923 LOG (GNUNET_ERROR_TYPE_DEBUG,
961 "Scheduling task to reconnect to transport service in %llu ms.\n", 924 "Scheduling task to reconnect to transport service in %llu ms.\n",
962 h->reconnect_delay.rel_value); 925 h->reconnect_delay.rel_value);
963#endif
964 h->reconnect_task = 926 h->reconnect_task =
965 GNUNET_SCHEDULER_add_delayed (h->reconnect_delay, &reconnect, h); 927 GNUNET_SCHEDULER_add_delayed (h->reconnect_delay, &reconnect, h);
966 if (h->reconnect_delay.rel_value == 0) 928 if (h->reconnect_delay.rel_value == 0)
@@ -995,11 +957,9 @@ send_try_connect (void *cls, size_t size, void *buf)
995 GNUNET_free (pid); 957 GNUNET_free (pid);
996 return 0; 958 return 0;
997 } 959 }
998#if DEBUG_TRANSPORT_API
999 LOG (GNUNET_ERROR_TYPE_DEBUG, 960 LOG (GNUNET_ERROR_TYPE_DEBUG,
1000 "Transmitting `%s' request with respect to `%4s'.\n", "REQUEST_CONNECT", 961 "Transmitting `%s' request with respect to `%4s'.\n", "REQUEST_CONNECT",
1001 GNUNET_i2s (pid)); 962 GNUNET_i2s (pid));
1002#endif
1003 GNUNET_assert (size >= sizeof (struct TransportRequestConnectMessage)); 963 GNUNET_assert (size >= sizeof (struct TransportRequestConnectMessage));
1004 msg.header.size = htons (sizeof (struct TransportRequestConnectMessage)); 964 msg.header.size = htons (sizeof (struct TransportRequestConnectMessage));
1005 msg.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_REQUEST_CONNECT); 965 msg.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_REQUEST_CONNECT);
@@ -1050,16 +1010,12 @@ send_hello (void *cls, size_t size, void *buf)
1050 1010
1051 if (buf == NULL) 1011 if (buf == NULL)
1052 { 1012 {
1053#if DEBUG_TRANSPORT_TIMEOUT
1054 LOG (GNUNET_ERROR_TYPE_DEBUG, 1013 LOG (GNUNET_ERROR_TYPE_DEBUG,
1055 "Timeout while trying to transmit `%s' request.\n", "HELLO"); 1014 "Timeout while trying to transmit `%s' request.\n", "HELLO");
1056#endif
1057 GNUNET_free (msg); 1015 GNUNET_free (msg);
1058 return 0; 1016 return 0;
1059 } 1017 }
1060#if DEBUG_TRANSPORT_API
1061 LOG (GNUNET_ERROR_TYPE_DEBUG, "Transmitting `%s' request.\n", "HELLO"); 1018 LOG (GNUNET_ERROR_TYPE_DEBUG, "Transmitting `%s' request.\n", "HELLO");
1062#endif
1063 ssize = ntohs (msg->size); 1019 ssize = ntohs (msg->size);
1064 GNUNET_assert (size >= ssize); 1020 GNUNET_assert (size >= ssize);
1065 memcpy (buf, msg, ssize); 1021 memcpy (buf, msg, ssize);
@@ -1101,11 +1057,9 @@ GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle,
1101 } 1057 }
1102 msg = GNUNET_malloc (size); 1058 msg = GNUNET_malloc (size);
1103 memcpy (msg, hello, size); 1059 memcpy (msg, hello, size);
1104#if DEBUG_TRANSPORT_API
1105 LOG (GNUNET_ERROR_TYPE_DEBUG, 1060 LOG (GNUNET_ERROR_TYPE_DEBUG,
1106 "Offering `%s' message of `%4s' to transport for validation.\n", "HELLO", 1061 "Offering `%s' message of `%4s' to transport for validation.\n", "HELLO",
1107 GNUNET_i2s (&peer)); 1062 GNUNET_i2s (&peer));
1108#endif
1109 schedule_control_transmit (handle, size, &send_hello, msg); 1063 schedule_control_transmit (handle, size, &send_hello, msg);
1110} 1064}
1111 1065
@@ -1204,9 +1158,7 @@ GNUNET_TRANSPORT_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
1204void 1158void
1205GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle) 1159GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle)
1206{ 1160{
1207#if DEBUG_TRANSPORT_API
1208 LOG (GNUNET_ERROR_TYPE_DEBUG, "Transport disconnect called!\n"); 1161 LOG (GNUNET_ERROR_TYPE_DEBUG, "Transport disconnect called!\n");
1209#endif
1210 /* this disconnects all neighbours... */ 1162 /* this disconnects all neighbours... */
1211 if (handle->reconnect_task == GNUNET_SCHEDULER_NO_TASK) 1163 if (handle->reconnect_task == GNUNET_SCHEDULER_NO_TASK)
1212 disconnect_and_schedule_reconnect (handle); 1164 disconnect_and_schedule_reconnect (handle);
@@ -1291,11 +1243,9 @@ GNUNET_TRANSPORT_notify_transmit_ready (struct GNUNET_TRANSPORT_Handle *handle,
1291 delay = GNUNET_BANDWIDTH_tracker_get_delay (&n->out_tracker, size); 1243 delay = GNUNET_BANDWIDTH_tracker_get_delay (&n->out_tracker, size);
1292 if (delay.rel_value > timeout.rel_value) 1244 if (delay.rel_value > timeout.rel_value)
1293 delay.rel_value = 0; /* notify immediately (with failure) */ 1245 delay.rel_value = 0; /* notify immediately (with failure) */
1294#if DEBUG_TRANSPORT_API
1295 LOG (GNUNET_ERROR_TYPE_DEBUG, 1246 LOG (GNUNET_ERROR_TYPE_DEBUG,
1296 "Bandwidth tracker allows next transmission to peer %s in %llu ms\n", 1247 "Bandwidth tracker allows next transmission to peer %s in %llu ms\n",
1297 GNUNET_i2s (target), (unsigned long long) delay.rel_value); 1248 GNUNET_i2s (target), (unsigned long long) delay.rel_value);
1298#endif
1299 n->hn = GNUNET_CONTAINER_heap_insert (handle->ready_heap, n, delay.rel_value); 1249 n->hn = GNUNET_CONTAINER_heap_insert (handle->ready_heap, n, delay.rel_value);
1300 schedule_transmission (handle); 1250 schedule_transmission (handle);
1301 return th; 1251 return th;
diff --git a/src/util/container_heap.c b/src/util/container_heap.c
index c34e220ce..b9cab1e9c 100644
--- a/src/util/container_heap.c
+++ b/src/util/container_heap.c
@@ -30,7 +30,7 @@
30 30
31#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 31#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
32 32
33#define DEBUG 0 33#define EXTRA_CHECKS 0
34 34
35/** 35/**
36 * Node in the heap. 36 * Node in the heap.
@@ -104,7 +104,7 @@ struct GNUNET_CONTAINER_Heap
104}; 104};
105 105
106 106
107#if DEBUG 107#if EXTRA_CHECKS
108/** 108/**
109 * Check if internal invariants hold for the given node. 109 * Check if internal invariants hold for the given node.
110 * 110 *
@@ -401,7 +401,7 @@ GNUNET_CONTAINER_heap_remove_root (struct GNUNET_CONTAINER_Heap *heap)
401 insert_node (heap, heap->root, root->right_child); 401 insert_node (heap, heap->root, root->right_child);
402 } 402 }
403 GNUNET_free (root); 403 GNUNET_free (root);
404#if DEBUG 404#if EXTRA_CHECKS
405 GNUNET_assert (((heap->size == 0) && (heap->root == NULL)) || 405 GNUNET_assert (((heap->size == 0) && (heap->root == NULL)) ||
406 (heap->size == heap->root->tree_size + 1)); 406 (heap->size == heap->root->tree_size + 1));
407 CHECK (heap->root); 407 CHECK (heap->root);
@@ -502,7 +502,7 @@ GNUNET_CONTAINER_heap_remove_node (struct GNUNET_CONTAINER_HeapNode *node)
502 if (heap->walk_pos == node) 502 if (heap->walk_pos == node)
503 heap->walk_pos = NULL; 503 heap->walk_pos = NULL;
504 GNUNET_free (node); 504 GNUNET_free (node);
505#if DEBUG 505#if EXTRA_CHECKS
506 CHECK (heap->root); 506 CHECK (heap->root);
507 GNUNET_assert (((heap->size == 0) && (heap->root == NULL)) || 507 GNUNET_assert (((heap->size == 0) && (heap->root == NULL)) ||
508 (heap->size == heap->root->tree_size + 1)); 508 (heap->size == heap->root->tree_size + 1));
@@ -523,13 +523,13 @@ GNUNET_CONTAINER_heap_update_cost (struct GNUNET_CONTAINER_Heap *heap,
523 struct GNUNET_CONTAINER_HeapNode *node, 523 struct GNUNET_CONTAINER_HeapNode *node,
524 GNUNET_CONTAINER_HeapCostType new_cost) 524 GNUNET_CONTAINER_HeapCostType new_cost)
525{ 525{
526#if DEBUG 526#if EXTRA_CHECKS
527 GNUNET_assert (((heap->size == 0) && (heap->root == NULL)) || 527 GNUNET_assert (((heap->size == 0) && (heap->root == NULL)) ||
528 (heap->size == heap->root->tree_size + 1)); 528 (heap->size == heap->root->tree_size + 1));
529 CHECK (heap->root); 529 CHECK (heap->root);
530#endif 530#endif
531 remove_node (node); 531 remove_node (node);
532#if DEBUG 532#if EXTRA_CHECKS
533 CHECK (heap->root); 533 CHECK (heap->root);
534 GNUNET_assert (((heap->size == 1) && (heap->root == NULL)) || 534 GNUNET_assert (((heap->size == 1) && (heap->root == NULL)) ||
535 (heap->size == heap->root->tree_size + 2)); 535 (heap->size == heap->root->tree_size + 2));
@@ -539,7 +539,7 @@ GNUNET_CONTAINER_heap_update_cost (struct GNUNET_CONTAINER_Heap *heap,
539 heap->root = node; 539 heap->root = node;
540 else 540 else
541 insert_node (heap, heap->root, node); 541 insert_node (heap, heap->root, node);
542#if DEBUG 542#if EXTRA_CHECKS
543 CHECK (heap->root); 543 CHECK (heap->root);
544 GNUNET_assert (((heap->size == 0) && (heap->root == NULL)) || 544 GNUNET_assert (((heap->size == 0) && (heap->root == NULL)) ||
545 (heap->size == heap->root->tree_size + 1)); 545 (heap->size == heap->root->tree_size + 1));
diff --git a/src/util/gnunet-service-resolver.c b/src/util/gnunet-service-resolver.c
index f20666a38..97eba6d11 100644
--- a/src/util/gnunet-service-resolver.c
+++ b/src/util/gnunet-service-resolver.c
@@ -490,10 +490,8 @@ handle_get (void *cls, struct GNUNET_SERVER_Client *client,
490 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); 490 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
491 return; 491 return;
492 } 492 }
493#if DEBUG_RESOLVER 493 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Resolver asked to look up `%s'.\n",
494 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, _("Resolver asked to look up `%s'.\n"),
495 hostname); 494 hostname);
496#endif
497 get_ip_from_hostname (client, hostname, af); 495 get_ip_from_hostname (client, hostname, af);
498 return; 496 return;
499 } 497 }
@@ -521,15 +519,13 @@ handle_get (void *cls, struct GNUNET_SERVER_Client *client,
521 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); 519 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
522 return; 520 return;
523 } 521 }
524#if DEBUG_RESOLVER
525 { 522 {
526 char buf[INET6_ADDRSTRLEN]; 523 char buf[INET6_ADDRSTRLEN];
527 524
528 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 525 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
529 _("Resolver asked to look up IP address `%s'.\n"), 526 "Resolver asked to look up IP address `%s'.\n",
530 inet_ntop (af, ip, buf, sizeof (buf))); 527 inet_ntop (af, ip, buf, sizeof (buf)));
531 } 528 }
532#endif
533 get_ip_as_string (client, af, ip); 529 get_ip_as_string (client, af, ip);
534} 530}
535 531
diff --git a/src/util/resolver.h b/src/util/resolver.h
index 2c0de9910..b77c19926 100644
--- a/src/util/resolver.h
+++ b/src/util/resolver.h
@@ -27,8 +27,6 @@
27 27
28#include "gnunet_common.h" 28#include "gnunet_common.h"
29 29
30#define DEBUG_RESOLVER GNUNET_EXTRA_LOGGING
31
32GNUNET_NETWORK_STRUCT_BEGIN 30GNUNET_NETWORK_STRUCT_BEGIN
33 31
34/** 32/**
diff --git a/src/util/resolver_api.c b/src/util/resolver_api.c
index ab0574efa..87b76f12d 100644
--- a/src/util/resolver_api.c
+++ b/src/util/resolver_api.c
@@ -250,9 +250,7 @@ GNUNET_RESOLVER_disconnect ()
250 GNUNET_assert (NULL == req_tail); 250 GNUNET_assert (NULL == req_tail);
251 if (NULL != client) 251 if (NULL != client)
252 { 252 {
253#if DEBUG_RESOLVER
254 LOG (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from DNS service\n"); 253 LOG (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from DNS service\n");
255#endif
256 GNUNET_CLIENT_disconnect (client); 254 GNUNET_CLIENT_disconnect (client);
257 client = NULL; 255 client = NULL;
258 } 256 }
@@ -339,9 +337,7 @@ handle_response (void *cls, const struct GNUNET_MessageHeader *msg)
339 struct GNUNET_RESOLVER_RequestHandle *rh = cls; 337 struct GNUNET_RESOLVER_RequestHandle *rh = cls;
340 uint16_t size; 338 uint16_t size;
341 339
342#if DEBUG_RESOLVER
343 LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving response from DNS service\n"); 340 LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving response from DNS service\n");
344#endif
345 if (msg == NULL) 341 if (msg == NULL)
346 { 342 {
347 char buf[INET6_ADDRSTRLEN]; 343 char buf[INET6_ADDRSTRLEN];
@@ -422,10 +418,8 @@ handle_response (void *cls, const struct GNUNET_MessageHeader *msg)
422 reconnect (); 418 reconnect ();
423 return; 419 return;
424 } 420 }
425#if DEBUG_RESOLVER 421 LOG (GNUNET_ERROR_TYPE_DEBUG, "Resolver returns `%s' for IP `%s'.\n",
426 LOG (GNUNET_ERROR_TYPE_DEBUG, _("Resolver returns `%s' for IP `%s'.\n"),
427 hostname, GNUNET_a2s ((const void *) &rh[1], rh->data_len)); 422 hostname, GNUNET_a2s ((const void *) &rh[1], rh->data_len));
428#endif
429 if (rh->was_transmitted != GNUNET_SYSERR) 423 if (rh->was_transmitted != GNUNET_SYSERR)
430 rh->name_callback (rh->cls, hostname); 424 rh->name_callback (rh->cls, hostname);
431 rh->received_response = GNUNET_YES; 425 rh->received_response = GNUNET_YES;
@@ -633,10 +627,8 @@ process_requests ()
633 msg->direction = htonl (rh->direction); 627 msg->direction = htonl (rh->direction);
634 msg->af = htonl (rh->af); 628 msg->af = htonl (rh->af);
635 memcpy (&msg[1], &rh[1], rh->data_len); 629 memcpy (&msg[1], &rh[1], rh->data_len);
636#if DEBUG_RESOLVER
637 LOG (GNUNET_ERROR_TYPE_DEBUG, 630 LOG (GNUNET_ERROR_TYPE_DEBUG,
638 "Transmitting DNS resolution request to DNS service\n"); 631 "Transmitting DNS resolution request to DNS service\n");
639#endif
640 if (GNUNET_OK != 632 if (GNUNET_OK !=
641 GNUNET_CLIENT_transmit_and_get_response (client, &msg->header, 633 GNUNET_CLIENT_transmit_and_get_response (client, &msg->header,
642 GNUNET_TIME_absolute_get_remaining 634 GNUNET_TIME_absolute_get_remaining
@@ -666,9 +658,7 @@ reconnect_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
666 return; /* no work pending */ 658 return; /* no work pending */
667 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 659 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
668 return; 660 return;
669#if DEBUG_RESOLVER
670 LOG (GNUNET_ERROR_TYPE_DEBUG, "Trying to connect to DNS service\n"); 661 LOG (GNUNET_ERROR_TYPE_DEBUG, "Trying to connect to DNS service\n");
671#endif
672 client = GNUNET_CLIENT_connect ("resolver", resolver_cfg); 662 client = GNUNET_CLIENT_connect ("resolver", resolver_cfg);
673 if (NULL == client) 663 if (NULL == client)
674 { 664 {
@@ -712,11 +702,9 @@ reconnect ()
712 break; 702 break;
713 } 703 }
714 } 704 }
715#if DEBUG_RESOLVER
716 LOG (GNUNET_ERROR_TYPE_DEBUG, 705 LOG (GNUNET_ERROR_TYPE_DEBUG,
717 "Will try to connect to DNS service in %llu ms\n", 706 "Will try to connect to DNS service in %llu ms\n",
718 (unsigned long long) backoff.rel_value); 707 (unsigned long long) backoff.rel_value);
719#endif
720 GNUNET_assert (NULL != resolver_cfg); 708 GNUNET_assert (NULL != resolver_cfg);
721 r_task = GNUNET_SCHEDULER_add_delayed (backoff, &reconnect_task, NULL); 709 r_task = GNUNET_SCHEDULER_add_delayed (backoff, &reconnect_task, NULL);
722 backoff = GNUNET_TIME_relative_multiply (backoff, 2); 710 backoff = GNUNET_TIME_relative_multiply (backoff, 2);
@@ -803,9 +791,7 @@ numeric_reverse (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
803 char *result; 791 char *result;
804 792
805 result = no_resolve (rh->af, &rh[1], rh->data_len); 793 result = no_resolve (rh->af, &rh[1], rh->data_len);
806#if DEBUG_RESOLVER 794 LOG (GNUNET_ERROR_TYPE_DEBUG, "Resolver returns `%s'.\n", result);
807 LOG (GNUNET_ERROR_TYPE_DEBUG, _("Resolver returns `%s'.\n"), result);
808#endif
809 if (result != NULL) 795 if (result != NULL)
810 { 796 {
811 rh->name_callback (rh->cls, result); 797 rh->name_callback (rh->cls, result);
@@ -897,9 +883,7 @@ GNUNET_RESOLVER_local_fqdn_get ()
897 "gethostname"); 883 "gethostname");
898 return NULL; 884 return NULL;
899 } 885 }
900#if DEBUG_RESOLVER 886 LOG (GNUNET_ERROR_TYPE_DEBUG, "Resolving our FQDN `%s'\n", hostname);
901 LOG (GNUNET_ERROR_TYPE_DEBUG, _("Resolving our FQDN `%s'\n"), hostname);
902#endif
903 host = gethostbyname (hostname); 887 host = gethostbyname (hostname);
904 if (NULL == host) 888 if (NULL == host)
905 { 889 {
@@ -934,9 +918,7 @@ GNUNET_RESOLVER_hostname_resolve (int af,
934 "gethostname"); 918 "gethostname");
935 return NULL; 919 return NULL;
936 } 920 }
937#if DEBUG_RESOLVER 921 LOG (GNUNET_ERROR_TYPE_DEBUG, "Resolving our hostname `%s'\n", hostname);
938 LOG (GNUNET_ERROR_TYPE_DEBUG, _("Resolving our hostname `%s'\n"), hostname);
939#endif
940 return GNUNET_RESOLVER_ip_get (hostname, af, timeout, callback, cls); 922 return GNUNET_RESOLVER_ip_get (hostname, af, timeout, callback, cls);
941} 923}
942 924
diff --git a/src/util/test_configuration.c b/src/util/test_configuration.c
index b1a446f86..1242a5c8d 100644
--- a/src/util/test_configuration.c
+++ b/src/util/test_configuration.c
@@ -28,7 +28,6 @@
28#include "gnunet_configuration_lib.h" 28#include "gnunet_configuration_lib.h"
29#include "gnunet_disk_lib.h" 29#include "gnunet_disk_lib.h"
30 30
31#define DEBUG GNUNET_EXTRA_LOGGING
32 31
33/* Test Configuration Diffs Options */ 32/* Test Configuration Diffs Options */
34enum 33enum
@@ -40,10 +39,8 @@ enum
40 ADD_NEW_ENTRY, 39 ADD_NEW_ENTRY,
41 REMOVE_SECTION, 40 REMOVE_SECTION,
42 REMOVE_ENTRY, 41 REMOVE_ENTRY,
43 COMPARE 42 COMPARE,
44#if DEBUG 43 PRINT
45 , PRINT
46#endif
47}; 44};
48 45
49static struct GNUNET_CONFIGURATION_Handle *cfg; 46static struct GNUNET_CONFIGURATION_Handle *cfg;