aboutsummaryrefslogtreecommitdiff
path: root/src/peerinfo
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2011-07-26 18:30:19 +0000
committerNathan S. Evans <evans@in.tum.de>2011-07-26 18:30:19 +0000
commita56f758246cd672b67e4a8369da3631ab1eedfc5 (patch)
tree7b5a61614bc0fc89a08b8a2f4edb80a03f1383a7 /src/peerinfo
parentacedd098b722cd5612f7ff9a15d712dd6e66ee62 (diff)
downloadgnunet-a56f758246cd672b67e4a8369da3631ab1eedfc5.tar.gz
gnunet-a56f758246cd672b67e4a8369da3631ab1eedfc5.zip
undo
Diffstat (limited to 'src/peerinfo')
-rw-r--r--src/peerinfo/test_peerinfo_api.c19
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
45static unsigned int retries; 45static unsigned int retries;
46 46
47struct GNUNET_PeerIdentity pid;
48
49static int 47static int
50check_it (void *cls, 48check_it (void *cls,
51 const char *tname, 49 const char *tname,
@@ -85,6 +83,7 @@ static void
85add_peer () 83add_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);