[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r6755 - in GNUnet/src: applications/fs/fsui include
From: |
gnunet |
Subject: |
[GNUnet-SVN] r6755 - in GNUnet/src: applications/fs/fsui include |
Date: |
Fri, 25 Apr 2008 00:10:10 -0600 (MDT) |
Author: grothoff
Date: 2008-04-25 00:10:10 -0600 (Fri, 25 Apr 2008)
New Revision: 6755
Modified:
GNUnet/src/applications/fs/fsui/downloadtest.c
GNUnet/src/include/gnunet_fsui_lib.h
Log:
fix
Modified: GNUnet/src/applications/fs/fsui/downloadtest.c
===================================================================
--- GNUnet/src/applications/fs/fsui/downloadtest.c 2008-04-25 05:23:42 UTC
(rev 6754)
+++ GNUnet/src/applications/fs/fsui/downloadtest.c 2008-04-25 06:10:10 UTC
(rev 6755)
@@ -1,6 +1,6 @@
/*
This file is part of GNUnet.
- (C) 2004, 2005, 2006 Christian Grothoff (and other contributing authors)
+ (C) 2004, 2005, 2006, 2008 Christian Grothoff (and other contributing
authors)
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
@@ -51,6 +51,7 @@
static volatile enum GNUNET_FSUI_EventType lastEvent;
static volatile enum GNUNET_FSUI_EventType waitForEvent;
+static volatile int search_done;
static struct GNUNET_FSUI_Context *ctx;
static struct GNUNET_ECRS_URI *upURI;
static struct GNUNET_FSUI_SearchList *search;
@@ -134,9 +135,7 @@
#if DEBUG_VERBOSE
printf ("Download complete.\n");
#endif
- GNUNET_FSUI_search_abort (search);
- GNUNET_FSUI_search_stop (search);
- search = NULL;
+ search_done = 1;
break;
case GNUNET_FSUI_download_progress:
#if DEBUG_VERBOSE > 1
@@ -277,10 +276,11 @@
GNUNET_snprintf (keyword, 40, "+%s +%s", keywords[0], keywords[1]);
uri = GNUNET_ECRS_keyword_string_to_uri (ectx, keyword);
waitForEvent = GNUNET_FSUI_download_completed;
+ search_done = 0;
search = GNUNET_FSUI_search_start (ctx, 0, uri);
CHECK (search != NULL);
prog = 0;
- while (search != NULL)
+ while (search_done == 0)
{
prog++;
CHECK (prog < 1000);
@@ -309,7 +309,9 @@
if (GNUNET_shutdown_test () == GNUNET_YES)
break;
}
- CHECK (search == NULL);
+ GNUNET_FSUI_search_abort (search);
+ GNUNET_FSUI_search_stop (search);
+ search = NULL;
CHECK (download != NULL);
waitForEvent = GNUNET_FSUI_unindex_completed;
unindex = GNUNET_FSUI_unindex_start (ctx, fn);
Modified: GNUnet/src/include/gnunet_fsui_lib.h
===================================================================
--- GNUnet/src/include/gnunet_fsui_lib.h 2008-04-25 05:23:42 UTC (rev
6754)
+++ GNUnet/src/include/gnunet_fsui_lib.h 2008-04-25 06:10:10 UTC (rev
6755)
@@ -844,6 +844,12 @@
* FSUI guarantees is that only one thread at a time will call the
* callback (so it need not be re-entrant).<p>
*
+ * The code in the callback is NOT allowed to abort, stop,
+ * resume or cancel any pending FSUI operation. The callback
+ * is allowed to start yet another FSUI operation (as long as
+ * the application can guarantee that FSUI_stop is not called
+ * before the FSUI_XXXX_start call returns).
+ *
* @return cctx for resume events, otherwise NULL
*/
typedef void *(*GNUNET_FSUI_EventProcessor) (void *cls,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r6755 - in GNUnet/src: applications/fs/fsui include,
gnunet <=