aboutsummaryrefslogtreecommitdiff
path: root/src/dht
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2013-03-06 10:38:19 +0000
committerBart Polot <bart@net.in.tum.de>2013-03-06 10:38:19 +0000
commitbea6a5e6fe596fe974bd6febbb17ce4731d1f7d8 (patch)
tree8cffc6f15967828771c73baeb879200329a0834d /src/dht
parent9bda9927dcd2550a99fe07920fb9690a102f2b0b (diff)
downloadgnunet-bea6a5e6fe596fe974bd6febbb17ce4731d1f7d8.tar.gz
gnunet-bea6a5e6fe596fe974bd6febbb17ce4731d1f7d8.zip
- new debug separation for dht-clients
Diffstat (limited to 'src/dht')
-rw-r--r--src/dht/gnunet-service-dht_clients.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/dht/gnunet-service-dht_clients.c b/src/dht/gnunet-service-dht_clients.c
index 3d9d5be5f..3a25cd88e 100644
--- a/src/dht/gnunet-service-dht_clients.c
+++ b/src/dht/gnunet-service-dht_clients.c
@@ -41,6 +41,7 @@
41 */ 41 */
42#define LOG_ROUTE_DETAILS_STDERR GNUNET_NO 42#define LOG_ROUTE_DETAILS_STDERR GNUNET_NO
43 43
44#define LOG(kind,...) GNUNET_log_from (kind, "dht-clients",__VA_ARGS__)
44 45
45/** 46/**
46 * Linked list of messages to send to clients. 47 * Linked list of messages to send to clients.
@@ -421,6 +422,9 @@ transmit_request (struct ClientQueryRecord *cqr)
421 peer_bf = 422 peer_bf =
422 GNUNET_CONTAINER_bloomfilter_init (NULL, DHT_BLOOM_SIZE, 423 GNUNET_CONTAINER_bloomfilter_init (NULL, DHT_BLOOM_SIZE,
423 GNUNET_CONSTANTS_BLOOMFILTER_K); 424 GNUNET_CONSTANTS_BLOOMFILTER_K);
425 LOG (GNUNET_ERROR_TYPE_DEBUG,
426 "Initiating GET for %s, replication %u, already have %u replies\n",
427 GNUNET_h2s(&cqr->key), cqr->replication, cqr->seen_replies_count);
424 GDS_NEIGHBOURS_handle_get (cqr->type, cqr->msg_options, cqr->replication, 428 GDS_NEIGHBOURS_handle_get (cqr->type, cqr->msg_options, cqr->replication,
425 0 /* hop count */ , 429 0 /* hop count */ ,
426 &cqr->key, cqr->xquery, cqr->xquery_size, reply_bf, 430 &cqr->key, cqr->xquery, cqr->xquery_size, reply_bf,
@@ -428,7 +432,8 @@ transmit_request (struct ClientQueryRecord *cqr)
428 GNUNET_CONTAINER_bloomfilter_free (reply_bf); 432 GNUNET_CONTAINER_bloomfilter_free (reply_bf);
429 GNUNET_CONTAINER_bloomfilter_free (peer_bf); 433 GNUNET_CONTAINER_bloomfilter_free (peer_bf);
430 434
431 /* exponential back-off for retries, max 1h */ 435 /* exponential back-off for retries.
436 * max GNUNET_TIME_STD_EXPONENTIAL_BACKOFF_THRESHOLD (15 min) */
432 cqr->retry_frequency = GNUNET_TIME_STD_BACKOFF (cqr->retry_frequency); 437 cqr->retry_frequency = GNUNET_TIME_STD_BACKOFF (cqr->retry_frequency);
433 cqr->retry_time = GNUNET_TIME_relative_to_absolute (cqr->retry_frequency); 438 cqr->retry_time = GNUNET_TIME_relative_to_absolute (cqr->retry_frequency);
434} 439}
@@ -504,10 +509,10 @@ handle_dht_local_put (void *cls, struct GNUNET_SERVER_Client *client,
504 GNUNET_NO); 509 GNUNET_NO);
505 dht_msg = (const struct GNUNET_DHT_ClientPutMessage *) message; 510 dht_msg = (const struct GNUNET_DHT_ClientPutMessage *) message;
506 /* give to local clients */ 511 /* give to local clients */
507 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 512 LOG (GNUNET_ERROR_TYPE_DEBUG,
508 "Handling local PUT of %u-bytes for query %s\n", 513 "Handling local PUT of %u-bytes for query %s\n",
509 size - sizeof (struct GNUNET_DHT_ClientPutMessage), 514 size - sizeof (struct GNUNET_DHT_ClientPutMessage),
510 GNUNET_h2s (&dht_msg->key)); 515 GNUNET_h2s (&dht_msg->key));
511 GDS_CLIENTS_handle_reply (GNUNET_TIME_absolute_ntoh (dht_msg->expiration), 516 GDS_CLIENTS_handle_reply (GNUNET_TIME_absolute_ntoh (dht_msg->expiration),
512 &dht_msg->key, 0, NULL, 0, NULL, 517 &dht_msg->key, 0, NULL, 0, NULL,
513 ntohl (dht_msg->type), 518 ntohl (dht_msg->type),
@@ -584,9 +589,9 @@ handle_dht_local_get (void *cls, struct GNUNET_SERVER_Client *client,
584 gettext_noop 589 gettext_noop
585 ("# GET requests received from clients"), 1, 590 ("# GET requests received from clients"), 1,
586 GNUNET_NO); 591 GNUNET_NO);
587 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 592 LOG (GNUNET_ERROR_TYPE_DEBUG,
588 "Received request for %s from local client %p\n", 593 "Received GET request for %s from local client %p\n",
589 GNUNET_h2s (&get->key), client); 594 GNUNET_h2s (&get->key), client);
590 595
591 if (LOG_ROUTE_DETAILS_STDERR) 596 if (LOG_ROUTE_DETAILS_STDERR)
592 { 597 {
@@ -790,8 +795,9 @@ handle_dht_local_get_stop (void *cls, struct GNUNET_SERVER_Client *client,
790 gettext_noop 795 gettext_noop
791 ("# GET STOP requests received from clients"), 1, 796 ("# GET STOP requests received from clients"), 1,
792 GNUNET_NO); 797 GNUNET_NO);
793 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Client %p stopped request for key %s\n", 798 LOG (GNUNET_ERROR_TYPE_DEBUG,
794 client, GNUNET_h2s (&dht_stop_msg->key)); 799 "Received GET STOP request for %s from local client %p\n",
800 client, GNUNET_h2s (&dht_stop_msg->key));
795 ctx.client = find_active_client (client); 801 ctx.client = find_active_client (client);
796 ctx.unique_id = dht_stop_msg->unique_id; 802 ctx.unique_id = dht_stop_msg->unique_id;
797 GNUNET_CONTAINER_multihashmap_get_multiple (forward_map, &dht_stop_msg->key, 803 GNUNET_CONTAINER_multihashmap_get_multiple (forward_map, &dht_stop_msg->key,