\fB\-n\fR, \fB\-\-no-network\fR
Only search locally, do not forward requests to other peers.
+.TP
+\fB\-t \fIVALUE\fR, \fB\-\-timeout=\fIVALUE\fR
+Automatically timeout search after VALUE ms. Otherwise the search runs until gnunet\-search is aborted with CTRL\-C.
+
.TP
\fB\-v\fR, \fB\-\-version\fR
print the version number
static unsigned int anonymity = 1;
+static unsigned long long timeout;
+
static int verbose;
static int local_only;
struct GNUNET_FS_Uri *uri;
unsigned int argc;
enum GNUNET_FS_SearchOptions options;
+ struct GNUNET_TIME_Relative delay;
argc = 0;
while (NULL != args[argc])
fprintf (stderr,
_("Could not create keyword URI from arguments.\n"));
ret = 1;
- GNUNET_FS_uri_destroy (uri);
return;
}
cfg = c;
ret = 1;
return;
}
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
- &shutdown_task,
- NULL);
+ if (timeout != 0)
+ {
+ delay.rel_value = timeout;
+ GNUNET_SCHEDULER_add_delayed (delay,
+ &shutdown_task,
+ NULL);
+ }
+ else
+ {
+ GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
+ &shutdown_task,
+ NULL);
+ }
}
gettext_noop
("write search results to file starting with PREFIX"),
1, &GNUNET_GETOPT_set_string, &output_filename},
+ {'t', "timeout", "VALUE",
+ gettext_noop
+ ("automatically terminate search after VALUE ms"),
+ 1, &GNUNET_GETOPT_set_ulong, &timeout},
{'V', "verbose", NULL,
gettext_noop ("be verbose (print progress information)"),
0, &GNUNET_GETOPT_set_one, &verbose},
GNUNET_GETOPT_OPTION_END
- };
+ };
return (GNUNET_OK ==
GNUNET_PROGRAM_run (argc,
argv,