[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r9974 - gnunet/src/peerinfo
From: |
gnunet |
Subject: |
[GNUnet-SVN] r9974 - gnunet/src/peerinfo |
Date: |
Mon, 11 Jan 2010 12:10:30 +0100 |
Author: grothoff
Date: 2010-01-11 12:10:30 +0100 (Mon, 11 Jan 2010)
New Revision: 9974
Modified:
gnunet/src/peerinfo/gnunet-peerinfo.c
gnunet/src/peerinfo/peerinfo.h
gnunet/src/peerinfo/peerinfo_api.c
Log:
support debugging
Modified: gnunet/src/peerinfo/gnunet-peerinfo.c
===================================================================
--- gnunet/src/peerinfo/gnunet-peerinfo.c 2010-01-11 11:10:14 UTC (rev
9973)
+++ gnunet/src/peerinfo/gnunet-peerinfo.c 2010-01-11 11:10:30 UTC (rev
9974)
@@ -97,9 +97,15 @@
{
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_filename (cfg,
- "GNUNET",
- "HOSTKEYFILE", &fn))
- return;
+ "GNUNETD",
+ "HOSTKEY", &fn))
+ {
+ fprintf (stderr,
+ _("Could not find option `%s:%s' in configuration.\n"),
+ "GNUNETD",
+ "HOSTKEYFILE");
+ return;
+ }
priv = GNUNET_CRYPTO_rsa_key_create_from_file (fn);
if (priv == NULL)
{
Modified: gnunet/src/peerinfo/peerinfo.h
===================================================================
--- gnunet/src/peerinfo/peerinfo.h 2010-01-11 11:10:14 UTC (rev 9973)
+++ gnunet/src/peerinfo/peerinfo.h 2010-01-11 11:10:30 UTC (rev 9974)
@@ -27,6 +27,7 @@
#include "gnunet_time_lib.h"
#include "gnunet_peerinfo_service.h"
+#define DEBUG_PEERINFO GNUNET_NO
/**
* Add the given peer to the list. This message
Modified: gnunet/src/peerinfo/peerinfo_api.c
===================================================================
--- gnunet/src/peerinfo/peerinfo_api.c 2010-01-11 11:10:14 UTC (rev 9973)
+++ gnunet/src/peerinfo/peerinfo_api.c 2010-01-11 11:10:30 UTC (rev 9974)
@@ -88,6 +88,11 @@
uint16_t hs;
struct CAFContext *cc;
+#if DEBUG_PEERINFO
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Adding peer `%s' to peerinfo database\n",
+ GNUNET_i2s(peer));
+#endif
client = GNUNET_CLIENT_connect (sched, "peerinfo", cfg);
if (client == NULL)
{
@@ -168,6 +173,10 @@
}
if (ntohs (msg->type) == GNUNET_MESSAGE_TYPE_PEERINFO_INFO_END)
{
+#if DEBUG_PEERINFO
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Received end of list of peers from peerinfo database\n");
+#endif
ic->callback (ic->callback_cls, NULL, NULL, 0);
GNUNET_CLIENT_disconnect (ic->client);
GNUNET_free (ic);
@@ -197,6 +206,11 @@
return;
}
}
+#if DEBUG_PEERINFO
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Received information about peer `%s' from peerinfo database\n",
+ GNUNET_i2s (&im->peer));
+#endif
ic->callback (ic->callback_cls, &im->peer, hello, ntohl (im->trust));
GNUNET_CLIENT_receive (ic->client,
&info_handler,
@@ -243,6 +257,10 @@
callback (callback_cls, NULL, NULL, 2);
return;
}
+#if DEBUG_PEERINFO
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Requesting list of peers from peerinfo database\n");
+#endif
ihc = GNUNET_malloc (sizeof (struct InfoContext) +
sizeof (struct ListPeerMessage));
ihc->client = client;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r9974 - gnunet/src/peerinfo,
gnunet <=