aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorРуслан Ижбулатов <lrn1986@gmail.com>2017-02-25 12:56:57 +0000
committerРуслан Ижбулатов <lrn1986@gmail.com>2017-02-25 21:03:50 +0000
commit320460014899596bd93f17cd8e968b393e8e5a85 (patch)
tree5b24acfe9473f6c0eafe8f9e65bfc4de7fb189ce /src
parentfa08d5e7122936f2adc73babf3ff83608d07620c (diff)
downloadgnunet-320460014899596bd93f17cd8e968b393e8e5a85.tar.gz
gnunet-320460014899596bd93f17cd8e968b393e8e5a85.zip
W32: port gnunet-gns-import to new zone iterator callback API
Diffstat (limited to 'src')
-rw-r--r--src/gns/gnunet-gns-import.c71
1 files changed, 39 insertions, 32 deletions
diff --git a/src/gns/gnunet-gns-import.c b/src/gns/gnunet-gns-import.c
index e98babfa8..49f6e495f 100644
--- a/src/gns/gnunet-gns-import.c
+++ b/src/gns/gnunet-gns-import.c
@@ -224,45 +224,52 @@ zone_iterator (void *cls,
224 else if (0 == strcmp (rname, "pin")) 224 else if (0 == strcmp (rname, "pin"))
225 check_pkey (rd_len, rd, pin_zone_pkey, &found_pin_rec); 225 check_pkey (rd_len, rd, pin_zone_pkey, &found_pin_rec);
226 } 226 }
227 if (NULL == rname && 0 == rd_len && NULL == rd) 227 GNUNET_NAMESTORE_zone_iterator_next (list_it);
228}
229
230static void
231zone_iteration_error (void *cls)
232{
233 enum GNUNET_OS_ProcessStatusType st;
234 unsigned long code;
235 if (!found_private_rec)
228 { 236 {
229 enum GNUNET_OS_ProcessStatusType st; 237 if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code,
230 unsigned long code; 238 "gnunet-namestore",
231 if (!found_private_rec) 239 "gnunet-namestore", "-z", "master-zone", "-a", "-e", "never", "-n", "private", "-p", "-t", "PKEY", "-V", private_zone_pkey, NULL))
232 { 240 {
233 if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, 241 ret = 8;
234 "gnunet-namestore", 242 return;
235 "gnunet-namestore", "-z", "master-zone", "-a", "-e", "never", "-n", "private", "-p", "-t", "PKEY", "-V", private_zone_pkey, NULL))
236 {
237 ret = 8;
238 return;
239 }
240 } 243 }
241 if (!found_short_rec) 244 }
245 if (!found_short_rec)
246 {
247 if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code,
248 "gnunet-namestore",
249 "gnunet-namestore", "-z", "master-zone", "-a", "-e", "never", "-n", "short", "-p", "-t", "PKEY", "-V", short_zone_pkey, NULL))
242 { 250 {
243 if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, 251 ret = 9;
244 "gnunet-namestore", 252 return;
245 "gnunet-namestore", "-z", "master-zone", "-a", "-e", "never", "-n", "short", "-p", "-t", "PKEY", "-V", short_zone_pkey, NULL))
246 {
247 ret = 9;
248 return;
249 }
250 } 253 }
251 if (!found_pin_rec) 254 }
255 if (!found_pin_rec)
256 {
257 if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code,
258 "gnunet-namestore",
259 "gnunet-namestore", "-z", "master-zone", "-a", "-e", "never", "-n", "pin", "-p", "-t", "PKEY", "-V", pin_zone_pkey, NULL))
252 { 260 {
253 if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, 261 ret = 10;
254 "gnunet-namestore", 262 return;
255 "gnunet-namestore", "-z", "master-zone", "-a", "-e", "never", "-n", "pin", "-p", "-t", "PKEY", "-V", pin_zone_pkey, NULL))
256 {
257 ret = 10;
258 return;
259 }
260 } 263 }
261 list_it = NULL;
262 GNUNET_SCHEDULER_shutdown ();
263 return;
264 } 264 }
265 GNUNET_NAMESTORE_zone_iterator_next (list_it); 265 list_it = NULL;
266 GNUNET_SCHEDULER_shutdown ();
267}
268
269
270static void
271zone_iteration_finished (void *cls)
272{
266} 273}
267 274
268 275
@@ -317,7 +324,7 @@ get_ego (void *cls,
317 return; 324 return;
318 } 325 }
319 list_it = GNUNET_NAMESTORE_zone_iteration_start (ns, 326 list_it = GNUNET_NAMESTORE_zone_iteration_start (ns,
320 &master_pk, &zone_iterator, NULL); 327 &master_pk, &zone_iteration_error, NULL, &zone_iterator, NULL, &zone_iteration_finished, NULL);
321 if (NULL == list_it) 328 if (NULL == list_it)
322 { 329 {
323 ret = 12; 330 ret = 12;