gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r2361 - in GNUnet/src/applications/fs: ecrs fsui


From: grothoff
Subject: [GNUnet-SVN] r2361 - in GNUnet/src/applications/fs: ecrs fsui
Date: Wed, 21 Dec 2005 02:13:35 -0800 (PST)

Author: grothoff
Date: 2005-12-21 02:13:33 -0800 (Wed, 21 Dec 2005)
New Revision: 2361

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

Modified: GNUnet/src/applications/fs/ecrs/download.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/download.c  2005-12-20 21:00:39 UTC (rev 
2360)
+++ GNUnet/src/applications/fs/ecrs/download.c  2005-12-21 10:13:33 UTC (rev 
2361)
@@ -1184,6 +1184,16 @@
       __FUNCTION__,
       filename);
 #endif
+  if (0 == ECRS_fileSize(uri)) {
+    ret = fileopen(filename, O_CREAT | O_WRONLY | O_TRUNC, S_IRUSR|S_IWUSR);
+    if (ret == -1) {
+      LOG_FILE_STRERROR(LOG_ERROR, "open", filename);
+      return SYSERR;
+    }
+    CLOSE(ret);
+    dpcb(0, 0, cronTime(NULL), 0, NULL, 0, dpcbClosure);
+    return OK;
+  }
   GNUNET_ASSERT(filename != NULL);
   fid = uri->data.chk;
   if (! ECRS_isFileUri(uri)) {

Modified: GNUnet/src/applications/fs/fsui/download.c
===================================================================
--- GNUnet/src/applications/fs/fsui/download.c  2005-12-20 21:00:39 UTC (rev 
2360)
+++ GNUnet/src/applications/fs/fsui/download.c  2005-12-21 10:13:33 UTC (rev 
2361)
@@ -293,7 +293,7 @@
       dl = dl->parent;
     }
   }
-#if DEBUG_DTM
+#if DEBUG_DTM 
   LOG(LOG_DEBUG,
       "Download thread for `%s' terminated (%s)...\n",
       dl->filename,
@@ -328,10 +328,9 @@
   LOG(LOG_DEBUG,
       "Starting download of file `%s'\n",
       filename);
-
   dl = MALLOC(sizeof(FSUI_DownloadList));
   memset(dl, 0, sizeof(FSUI_DownloadList));
-  cronTime(&dl->startTime);
+  cronTime(&dl->startTime); 
   dl->signalTerminate = SYSERR;
   dl->finished = NO;
   dl->is_recursive = is_recursive;
@@ -343,9 +342,9 @@
   dl->uri = ECRS_dupUri(uri);
   dl->total = ECRS_fileSize(uri);
   dl->next = parent->child;
+  totalBytes = ECRS_fileSize(uri);
   parent->child = dl;
 
-  totalBytes = ECRS_fileSize(uri);
   root = dl;
   while ( (root->parent != NULL) &&
          (root->parent != &dl->ctx->activeDownloads) ) {
@@ -415,7 +414,8 @@
   if ( (list->ctx->threadPoolSize
        > list->ctx->activeDownloadThreads) &&
        (list->signalTerminate == SYSERR) &&
-       (list->total > list->completed) &&
+       ( (list->total > list->completed) ||
+         (list->total == 0) ) &&
        (list->finished == NO) ) {
 #if DEBUG_DTM
     LOG(LOG_DEBUG,





reply via email to

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