gnunet-svn
[Top][All Lists]
Advanced

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

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


From: grothoff
Subject: [GNUnet-SVN] r2264 - GNUnet/src/applications/fs/fsui
Date: Sat, 19 Nov 2005 13:06:53 -0800 (PST)

Author: grothoff
Date: 2005-11-19 13:06:52 -0800 (Sat, 19 Nov 2005)
New Revision: 2264

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

Modified: GNUnet/src/applications/fs/fsui/download.c
===================================================================
--- GNUnet/src/applications/fs/fsui/download.c  2005-11-19 18:31:38 UTC (rev 
2263)
+++ GNUnet/src/applications/fs/fsui/download.c  2005-11-19 21:06:52 UTC (rev 
2264)
@@ -30,7 +30,7 @@
 #include "gnunet_fsui_lib.h"
 #include "fsui.h"
 
-#define DEBUG_DTM YES
+#define DEBUG_DTM NO
 
 /**
  * Start to download a file.
@@ -190,6 +190,11 @@
   FSUI_DownloadList * root;
   unsigned long long totalBytes;
 
+#if DEBUG_DTM
+  LOG(LOG_DEBUG,
+      "Download thread for `%s' started...\n",
+      dl->filename);
+#endif
   GNUNET_ASSERT(dl->ctx != NULL);
   GNUNET_ASSERT(dl->filename != NULL);
   ret = ECRS_downloadFile(dl->uri,
@@ -199,9 +204,12 @@
                          dl,
                          &testTerminate,
                          dl);
-  if (ret == OK)
+  if (ret == OK) {
     dl->finished = YES;
-  totalBytes = ECRS_fileSize(dl->uri);
+    totalBytes = ECRS_fileSize(dl->uri);
+  } else {
+    totalBytes = 0;
+  }
   root = dl;
   while (root->parent != &dl->ctx->activeDownloads) {
     root->completed += totalBytes;
@@ -285,6 +293,12 @@
       dl = dl->parent;
     }
   }
+#if DEBUG_DTM
+  LOG(LOG_DEBUG,
+      "Download thread for `%s' terminated (%s)...\n",
+      dl->filename,
+      ret == OK ? "COMPLETED" : "ABORTED");
+#endif
   return NULL;
 }
 
@@ -389,6 +403,13 @@
       list->ctx->activeDownloadThreads,
       list->ctx->threadPoolSize);
 #endif
+  LOG(LOG_DEBUG,
+      "Download thread manager investigates pending downlod of file `%s' (%d, 
%llu/%llu, %d)\n",
+      list->filename,
+      list->signalTerminate,
+      list->completed,
+      list->total,
+      list->finished);
   ret = NO;
   /* should this one be started? */
   if ( (list->ctx->threadPoolSize

Modified: GNUnet/src/applications/fs/fsui/fsui.c
===================================================================
--- GNUnet/src/applications/fs/fsui/fsui.c      2005-11-19 18:31:38 UTC (rev 
2263)
+++ GNUnet/src/applications/fs/fsui/fsui.c      2005-11-19 21:06:52 UTC (rev 
2264)
@@ -117,6 +117,7 @@
   ret->filename[big] = '\0';
   READLONG(ret->total);
   READLONG(ret->completed);
+  ret->completedFile = 0;
   READLONG(ret->startTime);
   ret->startTime = cronTime(NULL) - ret->startTime;
   ret->uri
@@ -149,9 +150,11 @@
                                ret);
 #if DEBUG_PERSISTENCE
   LOG(LOG_DEBUG,
-      "FSUI persistence: restoring download `%s': %s\n",
+      "FSUI persistence: restoring download `%s': %s (%llu, %llu)\n",
       ret->filename,
-      ret->finished == YES ? "finished" : "pending");
+      ret->finished == YES ? "finished" : "pending",
+      ret->completed,
+      ret->total);
 #endif
   return ret;
  ERR:
@@ -212,9 +215,11 @@
   }
 #if DEBUG_PERSISTENCE
   LOG(LOG_DEBUG,
-      "Serializing download state of download `%s': %s\n",
+      "Serializing download state of download `%s': %s (%llu, %llu)\n",
       list->filename,
-      list->finished == YES ? "finished" : "pending");
+      list->finished == YES ? "finished" : "pending",
+      list->completed,
+      list->total);
 #endif
   WRITE(fd, &nonzero, sizeof(char));
 





reply via email to

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