aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-search.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/gnunet-search.c')
-rw-r--r--src/fs/gnunet-search.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/fs/gnunet-search.c b/src/fs/gnunet-search.c
index a15d0d883..0ddcd892e 100644
--- a/src/fs/gnunet-search.c
+++ b/src/fs/gnunet-search.c
@@ -55,6 +55,9 @@ static int verbose;
55 55
56static int local_only; 56static int local_only;
57 57
58static struct GNUNET_SCHEDULER_Task *tt;
59
60
58/** 61/**
59 * Type of a function that libextractor calls for each 62 * Type of a function that libextractor calls for each
60 * meta data item found. 63 * meta data item found.
@@ -220,6 +223,14 @@ shutdown_task (void *cls)
220} 223}
221 224
222 225
226static void
227timeout_task (void *cls)
228{
229 tt = NULL;
230 GNUNET_SCHEDULER_shutdown ();
231}
232
233
223/** 234/**
224 * Main function that will be run by the scheduler. 235 * Main function that will be run by the scheduler.
225 * 236 *
@@ -272,10 +283,11 @@ run (void *cls, char *const *args, const char *cfgfile,
272 return; 283 return;
273 } 284 }
274 if (0 != timeout.rel_value_us) 285 if (0 != timeout.rel_value_us)
275 GNUNET_SCHEDULER_add_delayed (timeout, &shutdown_task, NULL); 286 tt = GNUNET_SCHEDULER_add_delayed (timeout,
276 else 287 &timeout_task,
277 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task, 288 NULL);
278 NULL); 289 GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
290 NULL);
279} 291}
280 292
281 293