Author: grothoff Date: 2008-02-19 22:28:58 -0700 (Tue, 19 Feb 2008) New Revision: 6390
Modified: GNUnet/src/applications/fs/fsui/fsui.h GNUnet/src/applications/fs/fsui/upload.c GNUnet/src/applications/sqstore_mysql/mysql.c GNUnet/todo Log: fixing 1240 Modified: GNUnet/src/applications/fs/fsui/fsui.h =================================================================== --- GNUnet/src/applications/fs/fsui/fsui.h 2008-02-20 04:11:42 UTC (rev 6389) +++ GNUnet/src/applications/fs/fsui/fsui.h 2008-02-20 05:28:58 UTC (rev 6390) @@ -306,6 +306,8 @@ char *extractor_config; + char *top_filename; + int doIndex; unsigned int anonymityLevel; Modified: GNUnet/src/applications/fs/fsui/upload.c =================================================================== --- GNUnet/src/applications/fs/fsui/upload.c 2008-02-20 04:11:42 UTC (rev 6389) +++ GNUnet/src/applications/fs/fsui/upload.c 2008-02-20 05:28:58 UTC (rev 6390) @@ -299,6 +299,7 @@ struct GNUNET_ECRS_URI *uri; struct GNUNET_ECRS_URI *loc; size_t tpos; + size_t tend; char *error; struct GNUNET_GE_Memory *mem; struct GNUNET_GE_Context *ee; @@ -407,6 +408,26 @@ strcat (pfn, DIR_SEPARATOR_STR); GNUNET_ECRS_meta_data_insert (utc->meta, EXTRACTOR_FILENAME, pfn); GNUNET_free (pfn); + if (0 != strcmp (utc->shared->top_filename, utc->filename)) + { + /* this is NOT the top-level upload, so we + should add the directory name of our + parent to the meta data */ + tend = tpos; /* index of '/' */ + if ((utc->filename[tpos] == DIR_SEPARATOR) && (tpos > 0)) + tpos--; + while ((tpos > 0) && (utc->filename[tpos] != DIR_SEPARATOR)) + tpos--; + if (tpos + 1 < tend) + { + pfn = GNUNET_malloc (tend - tpos + 1); + pfn[tend - tpos] = '\0'; + memcpy (pfn, &utc->filename[tpos + 1], tend - tpos); + GNUNET_ECRS_meta_data_insert (utc->meta, EXTRACTOR_RELATION, + pfn); + GNUNET_free (pfn); + } + } if ((utc->shared->anonymityLevel == 0) && (utc->shared->doIndex == GNUNET_YES)) { @@ -593,7 +614,8 @@ filename = GNUNET_malloc (strlen (dirName) + strlen (name) + 2); strcpy (filename, dirName); - strcat (filename, DIR_SEPARATOR_STR); + if (dirName[strlen (dirName) - 1] != DIR_SEPARATOR) + strcat (filename, DIR_SEPARATOR_STR); strcat (filename, name); md = GNUNET_ECRS_meta_data_create (); child = addUploads (parent->shared, filename, NULL, md, parent); @@ -697,6 +719,7 @@ GNUNET_ECRS_uri_destroy (shared->global_keywords); EXTRACTOR_removeAll (shared->extractors); GNUNET_free_non_null (shared->extractor_config); + GNUNET_free (shared->top_filename); GNUNET_free (shared); } @@ -761,7 +784,7 @@ shared->anonymityLevel = anonymityLevel; shared->priority = priority; shared->individualKeywords = individualKeywords; - shared->handle = NULL; + shared->top_filename = GNUNET_strdup (filename); ul = addUploads (shared, filename, keyUri, md, &ctx->activeUploads); if (ul == NULL) { Modified: GNUnet/src/applications/sqstore_mysql/mysql.c =================================================================== --- GNUnet/src/applications/sqstore_mysql/mysql.c 2008-02-20 04:11:42 UTC (rev 6389) +++ GNUnet/src/applications/sqstore_mysql/mysql.c 2008-02-20 05:28:58 UTC (rev 6390) @@ -452,11 +452,13 @@ PINIT (dbh->select_entry_by_hash, SELECT_ENTRY_BY_HASH); PINIT (dbh->select_entry_by_hash_and_vhash, SELECT_ENTRY_BY_HASH_AND_VHASH); PINIT (dbh->select_entry_by_hash_and_type, SELECT_ENTRY_BY_HASH_AND_TYPE); - PINIT (dbh->select_entry_by_hash_vhash_and_type, SELECT_ENTRY_BY_HASH_VHASH_AND_TYPE); + PINIT (dbh->select_entry_by_hash_vhash_and_type, + SELECT_ENTRY_BY_HASH_VHASH_AND_TYPE); PINIT (dbh->count_entry_by_hash, COUNT_ENTRY_BY_HASH); PINIT (dbh->count_entry_by_hash_and_vhash, COUNT_ENTRY_BY_HASH_AND_VHASH); PINIT (dbh->count_entry_by_hash_and_type, COUNT_ENTRY_BY_HASH_AND_TYPE); - PINIT (dbh->count_entry_by_hash_vhash_and_type, COUNT_ENTRY_BY_HASH_VHASH_AND_TYPE); + PINIT (dbh->count_entry_by_hash_vhash_and_type, + COUNT_ENTRY_BY_HASH_VHASH_AND_TYPE); PINIT (dbh->update_entry, UPDATE_ENTRY); PINIT (dbh->iter[0], SELECT_IT_LOW_PRIORITY); PINIT (dbh->iter[1], SELECT_IT_NON_ANONYMOUS); Modified: GNUnet/todo =================================================================== --- GNUnet/todo 2008-02-20 04:11:42 UTC (rev 6389) +++ GNUnet/todo 2008-02-20 05:28:58 UTC (rev 6390) @@ -5,7 +5,6 @@ PRE == to be done before a pre-release 0.8.0 [6'08] (aka "advanced features"): -- insert directory-name as metadata (#1240) - full support for FSUI pause/resume of search - power insert (#854) - clean up VPN code _______________________________________________ GNUnet-SVN mailing list GNUnet-SVN@gnu.org http://lists.gnu.org/mailman/listinfo/gnunet-svn