diff options
Diffstat (limited to 'src/peerinfo/test_peerinfo_api.c')
-rw-r--r-- | src/peerinfo/test_peerinfo_api.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/peerinfo/test_peerinfo_api.c b/src/peerinfo/test_peerinfo_api.c index 15efeccad..460a3764d 100644 --- a/src/peerinfo/test_peerinfo_api.c +++ b/src/peerinfo/test_peerinfo_api.c | |||
@@ -44,8 +44,6 @@ static struct GNUNET_PEERINFO_Handle *h; | |||
44 | 44 | ||
45 | static unsigned int retries; | 45 | static unsigned int retries; |
46 | 46 | ||
47 | struct GNUNET_PeerIdentity pid; | ||
48 | |||
49 | static int | 47 | static int |
50 | check_it (void *cls, | 48 | check_it (void *cls, |
51 | const char *tname, | 49 | const char *tname, |
@@ -85,6 +83,7 @@ static void | |||
85 | add_peer () | 83 | add_peer () |
86 | { | 84 | { |
87 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pkey; | 85 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pkey; |
86 | struct GNUNET_PeerIdentity pid; | ||
88 | struct GNUNET_HELLO_Message *h2; | 87 | struct GNUNET_HELLO_Message *h2; |
89 | size_t agc; | 88 | size_t agc; |
90 | 89 | ||
@@ -92,7 +91,7 @@ add_peer () | |||
92 | memset (&pkey, 32, sizeof (pkey)); | 91 | memset (&pkey, 32, sizeof (pkey)); |
93 | GNUNET_CRYPTO_hash (&pkey, sizeof (pkey), &pid.hashPubKey); | 92 | GNUNET_CRYPTO_hash (&pkey, sizeof (pkey), &pid.hashPubKey); |
94 | h2 = GNUNET_HELLO_create (&pkey, &address_generator, &agc); | 93 | h2 = GNUNET_HELLO_create (&pkey, &address_generator, &agc); |
95 | GNUNET_PEERINFO_standalone_add_peer (h, h2); | 94 | GNUNET_PEERINFO_add_peer (h, h2); |
96 | GNUNET_free (h2); | 95 | GNUNET_free (h2); |
97 | 96 | ||
98 | } | 97 | } |
@@ -109,7 +108,7 @@ process (void *cls, | |||
109 | 108 | ||
110 | if (err_msg != NULL) | 109 | if (err_msg != NULL) |
111 | { | 110 | { |
112 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 111 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
113 | _("Error in communication with PEERINFO service\n")); | 112 | _("Error in communication with PEERINFO service\n")); |
114 | } | 113 | } |
115 | 114 | ||
@@ -122,8 +121,8 @@ process (void *cls, | |||
122 | /* try again */ | 121 | /* try again */ |
123 | retries++; | 122 | retries++; |
124 | add_peer (); | 123 | add_peer (); |
125 | ic = GNUNET_PEERINFO_standalone_iterate (h, | 124 | ic = GNUNET_PEERINFO_iterate (h, |
126 | &pid, | 125 | NULL, |
127 | GNUNET_TIME_relative_multiply | 126 | GNUNET_TIME_relative_multiply |
128 | (GNUNET_TIME_UNIT_SECONDS, 15), | 127 | (GNUNET_TIME_UNIT_SECONDS, 15), |
129 | &process, cls); | 128 | &process, cls); |
@@ -131,7 +130,7 @@ process (void *cls, | |||
131 | } | 130 | } |
132 | GNUNET_assert (peer == NULL); | 131 | GNUNET_assert (peer == NULL); |
133 | GNUNET_assert (2 == *ok); | 132 | GNUNET_assert (2 == *ok); |
134 | GNUNET_PEERINFO_standalone_disconnect (h); | 133 | GNUNET_PEERINFO_disconnect (h); |
135 | h = NULL; | 134 | h = NULL; |
136 | *ok = 0; | 135 | *ok = 0; |
137 | return; | 136 | return; |
@@ -154,11 +153,11 @@ run (void *cls, | |||
154 | const struct GNUNET_CONFIGURATION_Handle *c) | 153 | const struct GNUNET_CONFIGURATION_Handle *c) |
155 | { | 154 | { |
156 | cfg = c; | 155 | cfg = c; |
157 | h = GNUNET_PEERINFO_standalone_connect (cfg); | 156 | h = GNUNET_PEERINFO_connect (cfg); |
158 | GNUNET_assert (h != NULL); | 157 | GNUNET_assert (h != NULL); |
159 | add_peer (); | 158 | add_peer (); |
160 | ic = GNUNET_PEERINFO_standalone_iterate (h, | 159 | ic = GNUNET_PEERINFO_iterate (h, |
161 | &pid, | 160 | NULL, |
162 | GNUNET_TIME_relative_multiply | 161 | GNUNET_TIME_relative_multiply |
163 | (GNUNET_TIME_UNIT_SECONDS, 15), | 162 | (GNUNET_TIME_UNIT_SECONDS, 15), |
164 | &process, cls); | 163 | &process, cls); |