aboutsummaryrefslogtreecommitdiff
path: root/src/fs
diff options
context:
space:
mode:
authormadmurphy <madmurphy333@gmail.com>2022-09-25 09:05:16 +0100
committermadmurphy <madmurphy333@gmail.com>2022-09-25 09:05:16 +0100
commitf669196680e705b1a677f2b2a6fb9af305a37e93 (patch)
tree1a27821589e8cecaa3e90589e799ca9478f8a768 /src/fs
parent6a9f604210b55eb75545eb6423c89093ec5417c5 (diff)
downloadgnunet-f669196680e705b1a677f2b2a6fb9af305a37e93.tar.gz
gnunet-f669196680e705b1a677f2b2a6fb9af305a37e93.zip
[gnunet-search] Fix `-s` and `-o` options not working together
Diffstat (limited to 'src/fs')
-rw-r--r--src/fs/gnunet-search.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/fs/gnunet-search.c b/src/fs/gnunet-search.c
index 7e2e4d2a6..54f0095ea 100644
--- a/src/fs/gnunet-search.c
+++ b/src/fs/gnunet-search.c
@@ -114,6 +114,8 @@ static int silent_mode;
114 114
115static struct GNUNET_SCHEDULER_Task *tt; 115static struct GNUNET_SCHEDULER_Task *tt;
116 116
117static int stop_searching;
118
117 119
118/** 120/**
119 * Print the escape sequence at the beginning of a string. 121 * Print the escape sequence at the beginning of a string.
@@ -474,7 +476,7 @@ progress_cb (void *const cls,
474 break; 476 break;
475 477
476 case GNUNET_FS_STATUS_SEARCH_RESULT: 478 case GNUNET_FS_STATUS_SEARCH_RESULT:
477 if (silent_mode) 479 if (stop_searching)
478 break; 480 break;
479 481
480 if (db != NULL) 482 if (db != NULL)
@@ -484,6 +486,9 @@ progress_cb (void *const cls,
484 info->value.search.specifics.result.meta, 486 info->value.search.specifics.result.meta,
485 NULL); 487 NULL);
486 488
489 if (silent_mode)
490 break;
491
487 cnt++; 492 cnt++;
488 filename = GNUNET_CONTAINER_meta_data_get_by_type ( 493 filename = GNUNET_CONTAINER_meta_data_get_by_type (
489 info->value.search.specifics.result.meta, 494 info->value.search.specifics.result.meta,
@@ -513,7 +518,7 @@ progress_cb (void *const cls,
513 { 518 {
514 GNUNET_SCHEDULER_shutdown (); 519 GNUNET_SCHEDULER_shutdown ();
515 /* otherwise the function might keep printing results for a while... */ 520 /* otherwise the function might keep printing results for a while... */
516 silent_mode = GNUNET_YES; 521 stop_searching = GNUNET_YES;
517 } 522 }
518 break; 523 break;
519 524
@@ -558,7 +563,7 @@ static void
558timeout_task (void *const cls) 563timeout_task (void *const cls)
559{ 564{
560 tt = NULL; 565 tt = NULL;
561 silent_mode = GNUNET_YES; 566 stop_searching = GNUNET_YES;
562 GNUNET_SCHEDULER_shutdown (); 567 GNUNET_SCHEDULER_shutdown ();
563} 568}
564 569