gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r145 - in GNUnet: . src/applications/fs/ecrs src/applicatio


From: grothoff
Subject: [GNUnet-SVN] r145 - in GNUnet: . src/applications/fs/ecrs src/applications/fs/fsui src/applications/fs/tools
Date: Tue, 1 Feb 2005 02:56:22 -0800 (PST)

Author: grothoff
Date: 2005-02-01 02:56:21 -0800 (Tue, 01 Feb 2005)
New Revision: 145

Modified:
   GNUnet/src/applications/fs/ecrs/meta.c
   GNUnet/src/applications/fs/fsui/upload.c
   GNUnet/src/applications/fs/tools/gnunet-search.c
   GNUnet/todo
Log:
fixing bug 796 -- hopefully

Modified: GNUnet/src/applications/fs/ecrs/meta.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/meta.c      2005-02-01 10:39:35 UTC (rev 
144)
+++ GNUnet/src/applications/fs/ecrs/meta.c      2005-02-01 10:56:21 UTC (rev 
145)
@@ -85,19 +85,25 @@
                         EXTRACTOR_KeywordType type,
                         const char * data) {
   int idx;
+  int ret = SYSERR;
   for (idx=0;idx<md->itemCount;idx++) {
     if ( (md->items[idx].type == type) &&
-        (0 == strcmp(md->items[idx].data,
-                     data)) ) {
+        ( (data == NULL) ||
+          (0 == strcmp(md->items[idx].data,
+                       data)) ) ) {
       FREE(md->items[idx].data);
       md->items[idx] = md->items[md->itemCount-1];
       GROW(md->items,
           md->itemCount,
           md->itemCount-1);
+      if (data == NULL) {
+       ret = OK;
+       continue;
+      }
       return OK;
     }      
   }
-  return SYSERR;
+  return ret;
 }
 
 /**

Modified: GNUnet/src/applications/fs/fsui/upload.c
===================================================================
--- GNUnet/src/applications/fs/fsui/upload.c    2005-02-01 10:39:35 UTC (rev 
144)
+++ GNUnet/src/applications/fs/fsui/upload.c    2005-02-01 10:56:21 UTC (rev 
145)
@@ -122,6 +122,9 @@
   while ( (lastSlash > 0) &&
          (utc->filename[lastSlash] != DIR_SEPARATOR))
     lastSlash--;  
+  ECRS_delFromMetaData(*meta,
+                      EXTRACTOR_FILENAME,
+                      NULL);
   ECRS_addToMetaData(*meta,
                     EXTRACTOR_FILENAME,
                     &utc->filename[lastSlash+1]);
@@ -284,7 +287,11 @@
   struct ECRS_URI * keywordUri;
   FSUI_Event event;
   int ret;
+  char * inboundFN;
 
+  inboundFN
+    = ECRS_getFromMetaData(utc->meta,
+                          EXTRACTOR_FILENAME);
   cronTime(&utc->start_time);
   utc->main_total = getFileSize(utc->main_filename);
   utc->main_completed = 0;
@@ -320,6 +327,10 @@
     utc->filename = NULL;
     if (utc->meta == NULL)
       utc->meta = ECRS_createMetaData();
+    else 
+      ECRS_delFromMetaData(utc->meta,
+                          EXTRACTOR_FILENAME,
+                          NULL);
     ECRS_extractMetaData(utc->meta,
                         utc->filename,
                         utc->extractors);
@@ -348,6 +359,14 @@
     event.data.message = _("Cannot upload directory without using 
recursion.\n");
   }
   if (ret == OK) { /* publish top-level advertisements */
+    if (inboundFN != NULL) {
+      ECRS_delFromMetaData(utc->meta,
+                          EXTRACTOR_FILENAME,
+                          NULL);
+      ECRS_addToMetaData(utc->meta,
+                        EXTRACTOR_FILENAME,
+                        inboundFN);
+    }
     keywordUri = ECRS_metaDataToUri(utc->meta);
     if (keywordUri != NULL) {
       ECRS_addToKeyspace(keywordUri,
@@ -388,6 +407,7 @@
   EXTRACTOR_removeAll(utc->extractors);
   utc->tl->isDone = YES;
   FREE(utc);
+  FREE(inboundFN);
   return NULL;
 }
 

Modified: GNUnet/src/applications/fs/tools/gnunet-search.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-search.c    2005-02-01 10:39:35 UTC 
(rev 144)
+++ GNUnet/src/applications/fs/tools/gnunet-search.c    2005-02-01 10:56:21 UTC 
(rev 145)
@@ -76,7 +76,7 @@
   uri = ECRS_uriToString(event->data.SearchResult.fi.uri);
   printf("%s:\n",
         uri);
-  filename = ECRS_getFromMetaData(meta,
+  filename = ECRS_getFromMetaData(event->data.SearchResult.fi.meta,
                                  EXTRACTOR_FILENAME);
   if (filename != NULL) 
     printf("gnunet-download -o \"%s\" %s\n",

Modified: GNUnet/todo
===================================================================
--- GNUnet/todo 2005-02-01 10:39:35 UTC (rev 144)
+++ GNUnet/todo 2005-02-01 10:56:21 UTC (rev 145)
@@ -6,7 +6,7 @@
 - 811?
 - 593???
 
-0.7.0pre0 [4'05] (aka "preview"):
+0.7.0pre0 [4'05] (aka "pre-preview"):
 - Missing Features:
   * fs/module/fs+migration: anonymity level and expiration time considerations 
(Christian)
   * gap: economy for local queries, forwardQuery dead?, anonymityLevel
@@ -20,7 +20,7 @@
   * gnunet-pseudonym
   * gnunet-search
 
-0.7.0pre1 [5'05]:
+0.7.0pre1 [5'05] (aka "preview"):
 - gnunet-insert:
   * allow any kind of meta-data to be specified on the
     command-line
@@ -52,6 +52,7 @@
   * gnunet-directory (no more categories) and gnunet-pseudonym (no passwords)
 
 0.7.x (aka "stabilization"):
+- add gnunet-gtk (or some other GUI)
 - gnunet-chat: have a real implementation.
 - DHT optimizations:
   * optional fields (HELOs)





reply via email to

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