aboutsummaryrefslogtreecommitdiff
path: root/src/peerinfo/peerinfo_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-01-18 09:45:40 +0000
committerChristian Grothoff <christian@grothoff.org>2010-01-18 09:45:40 +0000
commit260b2ebb0662c22d14f2482700c2211acb22b0d8 (patch)
tree94d4e3038d42cd9e8a0967407087c06ab6795811 /src/peerinfo/peerinfo_api.c
parent51ff626cb5d373cb7c066ad182af230f71c3ae01 (diff)
downloadgnunet-260b2ebb0662c22d14f2482700c2211acb22b0d8.tar.gz
gnunet-260b2ebb0662c22d14f2482700c2211acb22b0d8.zip
peerinfo fixes
Diffstat (limited to 'src/peerinfo/peerinfo_api.c')
-rw-r--r--src/peerinfo/peerinfo_api.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/peerinfo/peerinfo_api.c b/src/peerinfo/peerinfo_api.c
index f3479ab7b..0f95a421a 100644
--- a/src/peerinfo/peerinfo_api.c
+++ b/src/peerinfo/peerinfo_api.c
@@ -103,6 +103,12 @@ GNUNET_PEERINFO_add_peer (const struct GNUNET_CONFIGURATION_Handle *cfg,
103 return; 103 return;
104 } 104 }
105 hs = GNUNET_HELLO_size (hello); 105 hs = GNUNET_HELLO_size (hello);
106#if DEBUG_PEERINFO
107 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
108 "Size of `%s' is %u bytes\n",
109 "HELLO",
110 (unsigned int) GNUNET_HELLO_size (hello));
111#endif
106 pam = GNUNET_malloc (sizeof (struct PeerAddMessage) + hs); 112 pam = GNUNET_malloc (sizeof (struct PeerAddMessage) + hs);
107 pam->header.size = htons (hs + sizeof (struct PeerAddMessage)); 113 pam->header.size = htons (hs + sizeof (struct PeerAddMessage));
108 pam->header.type = htons (GNUNET_MESSAGE_TYPE_PEERINFO_ADD); 114 pam->header.type = htons (GNUNET_MESSAGE_TYPE_PEERINFO_ADD);
@@ -213,6 +219,12 @@ info_handler (void *cls, const struct GNUNET_MessageHeader *msg)
213 "Received information about peer `%s' from peerinfo database\n", 219 "Received information about peer `%s' from peerinfo database\n",
214 GNUNET_i2s (&im->peer)); 220 GNUNET_i2s (&im->peer));
215#endif 221#endif
222#if DEBUG_PEERINFO
223 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
224 "Size of `%s' is %u bytes\n",
225 "HELLO",
226 (unsigned int) GNUNET_HELLO_size (hello));
227#endif
216 ic->callback (ic->callback_cls, &im->peer, hello, ntohl (im->trust)); 228 ic->callback (ic->callback_cls, &im->peer, hello, ntohl (im->trust));
217 GNUNET_CLIENT_receive (ic->client, 229 GNUNET_CLIENT_receive (ic->client,
218 &info_handler, 230 &info_handler,