From 9608ed9c11c8e7c3d84fdb855ebcf57d2fb8745e Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 24 Oct 2011 20:53:44 +0000 Subject: [PATCH] even more logging --- src/dht/dht_api.c | 12 ++++++++++-- src/dht/gnunet-service-dht_clients.c | 9 ++++++++- 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) if (dht_msg->unique_id != get_handle->unique_id) { /* UID mismatch */ - LOG (GNUNET_ERROR_TYPE_DEBUG, "Ignoring reply (UID mismatch: %llu/%llu)\n", + LOG (GNUNET_ERROR_TYPE_DEBUG, + "Ignoring reply for %s: UID mismatch: %llu/%llu\n", + GNUNET_h2s (key), dht_msg->unique_id, get_handle->unique_id); return GNUNET_YES; } @@ -455,6 +457,10 @@ process_reply (void *cls, const GNUNET_HashCode * key, void *value) return GNUNET_NO; } data_length = msize - meta_length; + LOG (GNUNET_ERROR_TYPE_DEBUG, + "Giving %u byte reply for %s to application\n", + (unsigned int) data_length, + GNUNET_h2s (key)); put_path = (const struct GNUNET_PeerIdentity *) &dht_msg[1]; get_path = &put_path[put_path_length]; data = &get_path[get_path_length]; @@ -498,8 +504,10 @@ service_message_handler (void *cls, const struct GNUNET_MessageHeader *msg) do_disconnect (handle); return; } - LOG (GNUNET_ERROR_TYPE_DEBUG, "Received reply from DHT service\n"); dht_msg = (const struct GNUNET_DHT_ClientResultMessage *) msg; + LOG (GNUNET_ERROR_TYPE_DEBUG, + "Received reply for `%s' from DHT service\n", + GNUNET_h2s (&dht_msg->key)); GNUNET_CONTAINER_multihashmap_get_multiple (handle->active_requests, &dht_msg->key, &process_reply, (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) if (buf == NULL) { /* client disconnected */ + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Client %p disconnected, pending messages will be discarded\n", + client->client_handle); return 0; } off = 0; @@ -632,6 +635,10 @@ send_reply_to_client (void *cls, size_t size, void *buf) reply); memcpy (&cbuf[off], reply->msg, msize); GNUNET_free (reply); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Transmitting %u bytes to client %p\n", + msize, + client->client_handle); off += msize; } process_pending_messages (client); @@ -824,7 +831,7 @@ forward_reply (void *cls, const GNUNET_HashCode * key, void *value) reply = (struct GNUNET_DHT_ClientResultMessage*) &pm[1]; reply->unique_id = record->unique_id; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Queueing reply to query %s for peer %p\n", + "Queueing reply to query %s for client %p\n", GNUNET_h2s (key), record->client->client_handle); add_pending_message (record->client, pm); -- 2.25.1