aboutsummaryrefslogtreecommitdiff
path: root/src/peerinfo-tool
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-04-21 20:19:43 +0000
committerChristian Grothoff <christian@grothoff.org>2010-04-21 20:19:43 +0000
commit84e15afe4933ee2ca62e3e111ca261c3a986c157 (patch)
tree8a9cd9a06b723b940f6d11b0272f5eb395db39c4 /src/peerinfo-tool
parenta06d7742d5a48229767c152f9466432d17e162de (diff)
downloadgnunet-84e15afe4933ee2ca62e3e111ca261c3a986c157.tar.gz
gnunet-84e15afe4933ee2ca62e3e111ca261c3a986c157.zip
activating new peerinfo API
Diffstat (limited to 'src/peerinfo-tool')
-rw-r--r--src/peerinfo-tool/gnunet-peerinfo.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/peerinfo-tool/gnunet-peerinfo.c b/src/peerinfo-tool/gnunet-peerinfo.c
index 63c5cc008..5efd7262c 100644
--- a/src/peerinfo-tool/gnunet-peerinfo.c
+++ b/src/peerinfo-tool/gnunet-peerinfo.c
@@ -39,6 +39,8 @@ static int get_self;
39 39
40static struct GNUNET_SCHEDULER_Handle *sched; 40static struct GNUNET_SCHEDULER_Handle *sched;
41 41
42static struct GNUNET_PEERINFO_Handle *peerinfo;
43
42static const struct GNUNET_CONFIGURATION_Handle *cfg; 44static const struct GNUNET_CONFIGURATION_Handle *cfg;
43 45
44struct PrintContext 46struct PrintContext
@@ -166,7 +168,10 @@ print_peer_info (void *cls,
166 struct PrintContext *pc; 168 struct PrintContext *pc;
167 169
168 if (peer == NULL) 170 if (peer == NULL)
169 return; 171 {
172 GNUNET_PEERINFO_disconnect (peerinfo);
173 return;
174 }
170 if (be_quiet) 175 if (be_quiet)
171 { 176 {
172 GNUNET_CRYPTO_hash_to_enc (&peer->hashPubKey, &enc); 177 GNUNET_CRYPTO_hash_to_enc (&peer->hashPubKey, &enc);
@@ -212,8 +217,14 @@ run (void *cls,
212 cfg = c; 217 cfg = c;
213 if (get_self != GNUNET_YES) 218 if (get_self != GNUNET_YES)
214 { 219 {
215 (void) GNUNET_PEERINFO_iterate (cfg, 220 peerinfo = GNUNET_PEERINFO_connect (sched, cfg);
216 sched, 221 if (peerinfo == NULL)
222 {
223 fprintf (stderr,
224 _("Could not access PEERINFO service. Exiting.\n"));
225 return;
226 }
227 (void) GNUNET_PEERINFO_iterate (peerinfo,
217 NULL, 228 NULL,
218 0, 229 0,
219 GNUNET_TIME_relative_multiply 230 GNUNET_TIME_relative_multiply