ETA calculations, filename
authorChristian Grothoff <christian@grothoff.org>
Thu, 11 Mar 2010 13:48:36 +0000 (13:48 +0000)
committerChristian Grothoff <christian@grothoff.org>
Thu, 11 Mar 2010 13:48:36 +0000 (13:48 +0000)
src/fs/fs_file_information.c
src/fs/fs_publish.c

index 8e6f4263609f8003cff1980d91100d9911960c2b..a110822d12517817fd586bdb22ac8f2d26b417bf 100644 (file)
@@ -213,7 +213,12 @@ GNUNET_FS_file_information_create_from_file (void *client_info,
       return NULL;
     }
   fi = GNUNET_malloc (sizeof(struct FileInfo));
-  fi->filename = GNUNET_strdup (filename);
+  fi->filename = GNUNET_STRINGS_filename_expand (filename);
+  if (fi->filename == NULL)
+    {
+      GNUNET_free (fi);
+      return NULL;
+    }
   ret = GNUNET_FS_file_information_create_from_reader (client_info,
                                                       sbuf.st_size,
                                                       &data_reader_file,
index cf249c04b7b7c3ba890af9740bb89fe0802a2df2..df566b91765b7ce396121c7e037c6546db6c7c53 100644 (file)
@@ -901,12 +901,15 @@ do_upload (void *cls,
        hash_for_index_cb (sc,
                           &p->data.file.file_id);
       else
-       GNUNET_CRYPTO_hash_file (sc->h->sched,
-                                GNUNET_SCHEDULER_PRIORITY_IDLE,
-                                p->data.file.filename,
-                                HASHING_BLOCKSIZE,
-                                &hash_for_index_cb,
-                                sc);
+       {
+         p->start_time = GNUNET_TIME_absolute_get ();
+         GNUNET_CRYPTO_hash_file (sc->h->sched,
+                                  GNUNET_SCHEDULER_PRIORITY_IDLE,
+                                  p->data.file.filename,
+                                  HASHING_BLOCKSIZE,
+                                  &hash_for_index_cb,
+                                  sc);
+       }
       return;
     }
   publish_content (sc);