From: Christian Grothoff Date: Fri, 2 Apr 2010 11:48:33 +0000 (+0000) Subject: fix X-Git-Tag: initial-import-from-subversion-38251~22322 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d175a8b7f6720f5f51524fb26041cb08cea4753b;p=oweals%2Fgnunet.git fix --- diff --git a/TODO b/TODO index e557be286..7d591bd42 100644 --- a/TODO +++ b/TODO @@ -26,7 +26,8 @@ away), in order in which they will likely be done: - utilization can (easily, restart?) go out of control (very large), causing content expiration job to go crazy and delete everything! * FS: [CG] - - gnunet-publish seg faults if given a directory (!) + - gnunet-publish uses 'NULL' for the file name when + publishing a directory (!) - on some systems, keyword search does not find locally published content (need testcase of command-line tools! - also good to cover getopt API!) [could be related to datastore issue above!] diff --git a/src/fs/fs_file_information.c b/src/fs/fs_file_information.c index a110822d1..88d0ca386 100644 --- a/src/fs/fs_file_information.c +++ b/src/fs/fs_file_information.c @@ -752,8 +752,7 @@ GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir, { struct GNUNET_FS_FileInformation *pos; - if (dir->is_directory) - { + if (GNUNET_OK != proc (proc_cls, dir, dir->data.dir.dir_size, @@ -762,10 +761,14 @@ GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir, &dir->anonymity, &dir->priority, &dir->expirationTime, - &dir->client_info); - pos = dir->data.dir.entries; - while (pos != NULL) - { + &dir->client_info)) + return; + if (! dir->is_directory) + return; + pos = dir->data.dir.entries; + while (pos != NULL) + { + if (GNUNET_OK != proc (proc_cls, pos, (pos->is_directory) ? pos->data.dir.dir_size : pos->data.file.file_size, @@ -774,21 +777,9 @@ GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir, &pos->anonymity, &pos->priority, &pos->expirationTime, - &pos->client_info); - pos = pos->next; - } - } - else - { - proc (proc_cls, - dir, - dir->data.file.file_size, - dir->meta, - &dir->keywords, - &dir->anonymity, - &dir->priority, - &dir->expirationTime, - &dir->client_info); + &pos->client_info)) + break; + pos = pos->next; } } diff --git a/src/fs/gnunet-publish.c b/src/fs/gnunet-publish.c index 70964590d..b8017886e 100644 --- a/src/fs/gnunet-publish.c +++ b/src/fs/gnunet-publish.c @@ -275,6 +275,8 @@ publish_inspector (void *cls, char *fs; struct GNUNET_FS_Uri *new_uri; + if (cls == fi) + return GNUNET_OK; if (NULL != topKeywords) { if (*uri != NULL) @@ -320,7 +322,7 @@ publish_inspector (void *cls, if (GNUNET_YES == GNUNET_FS_meta_data_test_for_directory (m)) GNUNET_FS_file_information_inspect (fi, &publish_inspector, - NULL); + fi); return GNUNET_OK; }