aboutsummaryrefslogtreecommitdiff
path: root/src/peerinfo/test_peerinfo_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-01-22 16:55:16 +0000
committerChristian Grothoff <christian@grothoff.org>2010-01-22 16:55:16 +0000
commit98ea57dd2236542414e52792672d8563c8ca4294 (patch)
tree2b8e660b1f1ff325e447cf84b8eaa363ab77123c /src/peerinfo/test_peerinfo_api.c
parent48436941449d867ef9a32ddf29439c5017d37775 (diff)
downloadgnunet-98ea57dd2236542414e52792672d8563c8ca4294.tar.gz
gnunet-98ea57dd2236542414e52792672d8563c8ca4294.zip
fix
Diffstat (limited to 'src/peerinfo/test_peerinfo_api.c')
-rw-r--r--src/peerinfo/test_peerinfo_api.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/peerinfo/test_peerinfo_api.c b/src/peerinfo/test_peerinfo_api.c
index 0b5230eb6..0bea99b01 100644
--- a/src/peerinfo/test_peerinfo_api.c
+++ b/src/peerinfo/test_peerinfo_api.c
@@ -40,6 +40,8 @@ static struct GNUNET_SCHEDULER_Handle *sched;
40 40
41static const struct GNUNET_CONFIGURATION_Handle *cfg; 41static const struct GNUNET_CONFIGURATION_Handle *cfg;
42 42
43static struct GNUNET_PEERINFO_IteratorContext *ic;
44
43static unsigned int retries; 45static unsigned int retries;
44 46
45static int 47static int
@@ -105,19 +107,20 @@ process (void *cls,
105 107
106 if (peer == NULL) 108 if (peer == NULL)
107 { 109 {
110 ic = NULL;
108 if ( (3 == *ok) && 111 if ( (3 == *ok) &&
109 (retries < 5) ) 112 (retries < 50) )
110 { 113 {
111 /* try again */ 114 /* try again */
112 retries++; 115 retries++;
113 add_peer (); 116 add_peer ();
114 GNUNET_PEERINFO_iterate (cfg, 117 ic = GNUNET_PEERINFO_iterate (cfg,
115 sched, 118 sched,
116 NULL, 119 NULL,
117 0, 120 0,
118 GNUNET_TIME_relative_multiply 121 GNUNET_TIME_relative_multiply
119 (GNUNET_TIME_UNIT_SECONDS, 15), 122 (GNUNET_TIME_UNIT_SECONDS, 15),
120 &process, cls); 123 &process, cls);
121 return; 124 return;
122 } 125 }
123 GNUNET_assert (peer == NULL); 126 GNUNET_assert (peer == NULL);
@@ -126,7 +129,6 @@ process (void *cls,
126 *ok = 0; 129 *ok = 0;
127 return; 130 return;
128 } 131 }
129
130 if (hello != NULL) 132 if (hello != NULL)
131 { 133 {
132 GNUNET_assert (3 == *ok); 134 GNUNET_assert (3 == *ok);
@@ -148,12 +150,12 @@ run (void *cls,
148 sched = s; 150 sched = s;
149 cfg = c; 151 cfg = c;
150 add_peer (); 152 add_peer ();
151 GNUNET_PEERINFO_iterate (cfg, 153 ic = GNUNET_PEERINFO_iterate (cfg,
152 sched, 154 sched,
153 NULL, 155 NULL,
154 0, 156 0,
155 GNUNET_TIME_relative_multiply 157 GNUNET_TIME_relative_multiply
156 (GNUNET_TIME_UNIT_SECONDS, 15), &process, cls); 158 (GNUNET_TIME_UNIT_SECONDS, 15), &process, cls);
157} 159}
158 160
159 161