aboutsummaryrefslogtreecommitdiff
path: root/src/dht
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-10-24 20:53:44 +0000
committerChristian Grothoff <christian@grothoff.org>2011-10-24 20:53:44 +0000
commit9608ed9c11c8e7c3d84fdb855ebcf57d2fb8745e (patch)
tree20c37487a177e238d32a69d8a75ea6843c942305 /src/dht
parent4b6f36463759f1c7a9ed510471e0f84503e7d3ad (diff)
downloadgnunet-9608ed9c11c8e7c3d84fdb855ebcf57d2fb8745e.tar.gz
gnunet-9608ed9c11c8e7c3d84fdb855ebcf57d2fb8745e.zip
even more logging
Diffstat (limited to 'src/dht')
-rw-r--r--src/dht/dht_api.c12
-rw-r--r--src/dht/gnunet-service-dht_clients.c9
2 files changed, 18 insertions, 3 deletions
diff --git a/src/dht/dht_api.c b/src/dht/dht_api.c
index a50d2a228..4c653e105 100644
--- a/src/dht/dht_api.c
+++ b/src/dht/dht_api.c
@@ -435,7 +435,9 @@ process_reply (void *cls, const GNUNET_HashCode * key, void *value)
435 if (dht_msg->unique_id != get_handle->unique_id) 435 if (dht_msg->unique_id != get_handle->unique_id)
436 { 436 {
437 /* UID mismatch */ 437 /* UID mismatch */
438 LOG (GNUNET_ERROR_TYPE_DEBUG, "Ignoring reply (UID mismatch: %llu/%llu)\n", 438 LOG (GNUNET_ERROR_TYPE_DEBUG,
439 "Ignoring reply for %s: UID mismatch: %llu/%llu\n",
440 GNUNET_h2s (key),
439 dht_msg->unique_id, get_handle->unique_id); 441 dht_msg->unique_id, get_handle->unique_id);
440 return GNUNET_YES; 442 return GNUNET_YES;
441 } 443 }
@@ -455,6 +457,10 @@ process_reply (void *cls, const GNUNET_HashCode * key, void *value)
455 return GNUNET_NO; 457 return GNUNET_NO;
456 } 458 }
457 data_length = msize - meta_length; 459 data_length = msize - meta_length;
460 LOG (GNUNET_ERROR_TYPE_DEBUG,
461 "Giving %u byte reply for %s to application\n",
462 (unsigned int) data_length,
463 GNUNET_h2s (key));
458 put_path = (const struct GNUNET_PeerIdentity *) &dht_msg[1]; 464 put_path = (const struct GNUNET_PeerIdentity *) &dht_msg[1];
459 get_path = &put_path[put_path_length]; 465 get_path = &put_path[put_path_length];
460 data = &get_path[get_path_length]; 466 data = &get_path[get_path_length];
@@ -498,8 +504,10 @@ service_message_handler (void *cls, const struct GNUNET_MessageHeader *msg)
498 do_disconnect (handle); 504 do_disconnect (handle);
499 return; 505 return;
500 } 506 }
501 LOG (GNUNET_ERROR_TYPE_DEBUG, "Received reply from DHT service\n");
502 dht_msg = (const struct GNUNET_DHT_ClientResultMessage *) msg; 507 dht_msg = (const struct GNUNET_DHT_ClientResultMessage *) msg;
508 LOG (GNUNET_ERROR_TYPE_DEBUG,
509 "Received reply for `%s' from DHT service\n",
510 GNUNET_h2s (&dht_msg->key));
503 GNUNET_CONTAINER_multihashmap_get_multiple (handle->active_requests, 511 GNUNET_CONTAINER_multihashmap_get_multiple (handle->active_requests,
504 &dht_msg->key, &process_reply, 512 &dht_msg->key, &process_reply,
505 (void *) dht_msg); 513 (void *) dht_msg);
diff --git a/src/dht/gnunet-service-dht_clients.c b/src/dht/gnunet-service-dht_clients.c
index aa2fd9462..29096b030 100644
--- a/src/dht/gnunet-service-dht_clients.c
+++ b/src/dht/gnunet-service-dht_clients.c
@@ -622,6 +622,9 @@ send_reply_to_client (void *cls, size_t size, void *buf)
622 if (buf == NULL) 622 if (buf == NULL)
623 { 623 {
624 /* client disconnected */ 624 /* client disconnected */
625 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
626 "Client %p disconnected, pending messages will be discarded\n",
627 client->client_handle);
625 return 0; 628 return 0;
626 } 629 }
627 off = 0; 630 off = 0;
@@ -632,6 +635,10 @@ send_reply_to_client (void *cls, size_t size, void *buf)
632 reply); 635 reply);
633 memcpy (&cbuf[off], reply->msg, msize); 636 memcpy (&cbuf[off], reply->msg, msize);
634 GNUNET_free (reply); 637 GNUNET_free (reply);
638 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
639 "Transmitting %u bytes to client %p\n",
640 msize,
641 client->client_handle);
635 off += msize; 642 off += msize;
636 } 643 }
637 process_pending_messages (client); 644 process_pending_messages (client);
@@ -824,7 +831,7 @@ forward_reply (void *cls, const GNUNET_HashCode * key, void *value)
824 reply = (struct GNUNET_DHT_ClientResultMessage*) &pm[1]; 831 reply = (struct GNUNET_DHT_ClientResultMessage*) &pm[1];
825 reply->unique_id = record->unique_id; 832 reply->unique_id = record->unique_id;
826 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 833 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
827 "Queueing reply to query %s for peer %p\n", 834 "Queueing reply to query %s for client %p\n",
828 GNUNET_h2s (key), 835 GNUNET_h2s (key),
829 record->client->client_handle); 836 record->client->client_handle);
830 add_pending_message (record->client, pm); 837 add_pending_message (record->client, pm);