gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r3509 - GNUnet/src/applications/fs/fsui


From: grothoff
Subject: [GNUnet-SVN] r3509 - GNUnet/src/applications/fs/fsui
Date: Fri, 20 Oct 2006 11:52:32 -0700 (PDT)

Author: grothoff
Date: 2006-10-20 11:52:30 -0700 (Fri, 20 Oct 2006)
New Revision: 3509

Modified:
   GNUnet/src/applications/fs/fsui/downloadtest.c
   GNUnet/src/applications/fs/fsui/fsui.c
   GNUnet/src/applications/fs/fsui/fsuitest.c
   GNUnet/src/applications/fs/fsui/searchtest.c
   GNUnet/src/applications/fs/fsui/upload.c
Log:
testing

Modified: GNUnet/src/applications/fs/fsui/downloadtest.c
===================================================================
--- GNUnet/src/applications/fs/fsui/downloadtest.c      2006-10-20 05:49:29 UTC 
(rev 3508)
+++ GNUnet/src/applications/fs/fsui/downloadtest.c      2006-10-20 18:52:30 UTC 
(rev 3509)
@@ -35,7 +35,7 @@
 #include "gnunet_util_network_client.h"
 #include "gnunet_util_crypto.h"
 
-#define DEBUG_VERBOSE NO
+#define DEBUG_VERBOSE YES
 
 #define CHECK(a) if (!(a)) { ok = NO; GE_BREAK(ectx, 0); goto FAILURE; }
 
@@ -178,6 +178,9 @@
            event->type);
 #endif
     break;
+  case FSUI_upload_started:
+  case FSUI_upload_stopped:
+    break;
   default:
     printf("Unexpected event: %d\n",
           event->type);
@@ -191,9 +194,12 @@
 
 #define FILESIZE (1024 * 1024 * 2)
 
+#define START_DAEMON 0
 
 int main(int argc, char * argv[]){
+#if START_DAEMON
   pid_t daemon;
+#endif
   int ok;
   int i;
   struct ECRS_URI * uri = NULL;
@@ -219,6 +225,7 @@
     GC_free(cfg);
     return -1;  
   }
+#if START_DAEMON
   daemon  = os_daemon_start(NULL,
                            cfg,
                            "peer.conf",
@@ -229,7 +236,7 @@
                                                    30 * cronSECONDS));
   PTHREAD_SLEEP(5 * cronSECONDS); /* give apps time to start */
   /* ACTUAL TEST CODE */
-
+#endif
   ctx = FSUI_start(NULL,
                   cfg,
                   "fsuidownloadtest",
@@ -289,6 +296,8 @@
   waitForEvent = FSUI_download_completed;
   search = FSUI_startSearch(ctx,
                            0,
+                           100,
+                           240 * cronSECONDS,
                            uri);
   CHECK(search != NULL);
   prog = 0;
@@ -298,7 +307,7 @@
     PTHREAD_SLEEP(50 * cronMILLIS);
     if ( (suspendRestart > 0) &&
         (weak_randomi(4) == 0) ) {
-#if 1
+#if 0
 #if DEBUG_VERBOSE
       printf("Testing FSUI suspend-resume\n");
 #endif
@@ -369,9 +378,9 @@
   if (upURI != NULL)
     ECRS_freeUri(upURI);
 
-
- 
+#if START_DAEMON
   GE_ASSERT(NULL, OK == os_daemon_stop(NULL, daemon));
+#endif
   GC_free(cfg);
   return (ok == YES) ? 0 : 1;
 }

Modified: GNUnet/src/applications/fs/fsui/fsui.c
===================================================================
--- GNUnet/src/applications/fs/fsui/fsui.c      2006-10-20 05:49:29 UTC (rev 
3508)
+++ GNUnet/src/applications/fs/fsui/fsui.c      2006-10-20 18:52:30 UTC (rev 
3509)
@@ -177,6 +177,7 @@
                                      "GNUNET_HOME",
                                      GNUNET_HOME_DIRECTORY,
                                      &gh);
+  disk_directory_create(ectx, gh);
   fn = MALLOC(strlen(gh) + strlen(name) + 2 + 5);
   strcpy(fn, gh);
   FREE(gh);

Modified: GNUnet/src/applications/fs/fsui/fsuitest.c
===================================================================
--- GNUnet/src/applications/fs/fsui/fsuitest.c  2006-10-20 05:49:29 UTC (rev 
3508)
+++ GNUnet/src/applications/fs/fsui/fsuitest.c  2006-10-20 18:52:30 UTC (rev 
3509)
@@ -194,6 +194,8 @@
                                 keyword);
   search = FSUI_startSearch(ctx,
                            0,
+                           100,
+                           240 * cronSECONDS,
                            uri);
   CHECK(search != NULL);
   prog = 0;

Modified: GNUnet/src/applications/fs/fsui/searchtest.c
===================================================================
--- GNUnet/src/applications/fs/fsui/searchtest.c        2006-10-20 05:49:29 UTC 
(rev 3508)
+++ GNUnet/src/applications/fs/fsui/searchtest.c        2006-10-20 18:52:30 UTC 
(rev 3509)
@@ -149,6 +149,8 @@
   luri = ECRS_parseCharKeywordURI(NULL, keyword);
   search = FSUI_startSearch(ctx,
                            0,
+                           100,
+                           240 * cronSECONDS,
                            luri);
   ECRS_freeUri(luri);
   uri = NULL;

Modified: GNUnet/src/applications/fs/fsui/upload.c
===================================================================
--- GNUnet/src/applications/fs/fsui/upload.c    2006-10-20 05:49:29 UTC (rev 
3508)
+++ GNUnet/src/applications/fs/fsui/upload.c    2006-10-20 18:52:30 UTC (rev 
3509)
@@ -331,11 +331,20 @@
   ECRS_freeMetaData(ul->meta);
   /* unlink from parent */
   next = ul->parent->child;
+  if (next == NULL) {
+    GE_BREAK(NULL, 0);
+    return;
+  }
   if (next == ul) {
     ul->parent->child = ul->next;
   } else {
-    while (next->next != ul)
+    while (next->next != ul) {
       next = next->next;
+      if (next == NULL) {
+       GE_BREAK(NULL, 0);
+       return;
+      }
+    }
     next->next = ul->next;
   }
   FREE(ul);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]