even more logging
authorChristian Grothoff <christian@grothoff.org>
Mon, 24 Oct 2011 20:53:44 +0000 (20:53 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 24 Oct 2011 20:53:44 +0000 (20:53 +0000)
src/dht/dht_api.c
src/dht/gnunet-service-dht_clients.c

index a50d2a2287974eef7c8e492c87903cd8a4a614f2..4c653e1055db85cc0d05b83acf2eca307f4dac6d 100644 (file)
@@ -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);
index aa2fd946240dd7f30886d9e8040ec444c4f0ae20..29096b0303f3c2da76d7c15ee1923bd279ee8582 100644 (file)
@@ -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);