diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-01-22 16:55:16 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-01-22 16:55:16 +0000 |
commit | 98ea57dd2236542414e52792672d8563c8ca4294 (patch) | |
tree | 2b8e660b1f1ff325e447cf84b8eaa363ab77123c /src/peerinfo/test_peerinfo_api.c | |
parent | 48436941449d867ef9a32ddf29439c5017d37775 (diff) | |
download | gnunet-98ea57dd2236542414e52792672d8563c8ca4294.tar.gz gnunet-98ea57dd2236542414e52792672d8563c8ca4294.zip |
fix
Diffstat (limited to 'src/peerinfo/test_peerinfo_api.c')
-rw-r--r-- | src/peerinfo/test_peerinfo_api.c | 32 |
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 | ||
41 | static const struct GNUNET_CONFIGURATION_Handle *cfg; | 41 | static const struct GNUNET_CONFIGURATION_Handle *cfg; |
42 | 42 | ||
43 | static struct GNUNET_PEERINFO_IteratorContext *ic; | ||
44 | |||
43 | static unsigned int retries; | 45 | static unsigned int retries; |
44 | 46 | ||
45 | static int | 47 | static 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 | ||