gnunet-svn
[Top][All Lists]
Advanced

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

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


From: grothoff
Subject: [GNUnet-SVN] r1671 - GNUnet/src/applications/fs/fsui
Date: Sun, 14 Aug 2005 18:53:04 -0700 (PDT)

Author: grothoff
Date: 2005-08-14 18:53:03 -0700 (Sun, 14 Aug 2005)
New Revision: 1671

Modified:
   GNUnet/src/applications/fs/fsui/download.c
   GNUnet/src/applications/fs/fsui/downloadtest.c
Log:
fix

Modified: GNUnet/src/applications/fs/fsui/download.c
===================================================================
--- GNUnet/src/applications/fs/fsui/download.c  2005-08-15 01:30:32 UTC (rev 
1670)
+++ GNUnet/src/applications/fs/fsui/download.c  2005-08-15 01:53:03 UTC (rev 
1671)
@@ -450,9 +450,9 @@
      unlink us from the tree! */
   dpos = list->parent;
   if (dpos != NULL) {
-    if (dpos->child == list)
+    if (dpos->child == list) {
       dpos->child = list->next;
-    else {
+    } else {
       dpos = dpos->child;
       while ( (dpos != NULL) &&
              (dpos != list) )
@@ -563,24 +563,18 @@
                                 FSUI_DownloadIterator iter,
                                 void * closure) {
   FSUI_DownloadList * dl;
-  FSUI_DownloadList * prev;
+  FSUI_DownloadList * tmp;
   int ret;
   int stop;
 
   ret = 0;
   MUTEX_LOCK(&ctx->lock);
   dl = ctx->activeDownloads.child;
-  prev = NULL;
   stop = NO;
   while ( (dl != NULL) &&
          (stop == NO) ) {
     if ( (dl->completed == dl->total) &&
         (dl->signalTerminate == SYSERR) ) {
-      if (prev == NULL)
-       ctx->activeDownloads.child
-         = dl->next;
-      else
-       prev->next = dl->next;
       if (iter != NULL)
        if (OK != iter(closure,
                       dl,
@@ -591,11 +585,11 @@
                       dl->is_recursive,
                       dl->anonymityLevel))
          stop = YES;
+      tmp = dl->next;
       freeDownloadList(dl);
-      dl = prev->next;
+      dl = tmp;
       ret++;
     } else {
-      prev = dl;
       dl = dl->next;
     }
   }

Modified: GNUnet/src/applications/fs/fsui/downloadtest.c
===================================================================
--- GNUnet/src/applications/fs/fsui/downloadtest.c      2005-08-15 01:30:32 UTC 
(rev 1670)
+++ GNUnet/src/applications/fs/fsui/downloadtest.c      2005-08-15 01:53:03 UTC 
(rev 1671)
@@ -32,6 +32,8 @@
 #include "gnunet_util.h"
 #include "gnunet_fsui_lib.h"
 
+#define DEBUG_VERBOSE NO
+
 #define CHECK(a) if (!(a)) { ok = NO; BREAK(); goto FAILURE; }
 
 static volatile int suspendRestart = 0;
@@ -46,7 +48,7 @@
                                     NULL));
   FREENONNULL(setConfigurationString("GNUNET",
                                     "LOGLEVEL",
-                                    "DEBUG"));
+                                    "ERROR"));
   FREENONNULL(setConfigurationString("GNUNET",
                                     "GNUNETD-CONFIG",
                                     "check.conf"));
@@ -86,9 +88,11 @@
     printf("Received search result\n");
     break;
   case FSUI_upload_progress:
+#if DEBUG_VERBOSE
     printf("Upload is progressing (%llu/%llu)...\n",
           event->data.UploadProgress.completed,
           event->data.UploadProgress.total);
+#endif
     break;
   case FSUI_upload_complete:
     upURI = ECRS_dupUri(event->data.UploadComplete.uri);
@@ -98,14 +102,18 @@
     printf("Download complete.\n");
     break;
   case FSUI_download_progress:
+#if DEBUG_VERBOSE
     printf("Download is progressing (%llu/%llu)...\n",
           event->data.DownloadProgress.completed,
           event->data.DownloadProgress.total);
+#endif
     break;
   case FSUI_unindex_progress:
+#if DEBUG_VERBOSE
     printf("Unindex is progressing (%llu/%llu)...\n",
           event->data.UnindexProgress.completed,
           event->data.UnindexProgress.total);
+#endif
     break;
   case FSUI_unindex_complete:
     printf("Unindex complete.\n");
@@ -117,7 +125,9 @@
     errexit("Received ERROR: %d\n",
            event->type);
   case FSUI_download_aborted:
-    printf("Received unexpected download aborted event.\n");
+#if DEBUG_VERBOSE
+    printf("Received download aborted event.\n");
+#endif
     break;
   case FSUI_gnunetd_connected:
   case FSUI_gnunetd_disconnected:
@@ -242,15 +252,19 @@
         (randomi(4) == 0) ) {
       suspendCron();
 #if 1
+#if DEBUG_VERBOSE
       printf("Testing FSUI suspend-resume\n");
+#endif
       FSUI_stop(ctx); /* download possibly incomplete
                         at this point, thus testing resume */
       ctx = FSUI_start("fsuidownloadtest",
                       YES,
                       &eventCallback,
                       NULL);
+#if DEBUG_VERBOSE
       printf("Resumed...\n");
 #endif
+#endif
       resumeCron();
       suspendRestart--;
     }





reply via email to

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