aboutsummaryrefslogtreecommitdiff
path: root/src/fs/fs_publish.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-01-11 21:11:51 +0000
committerChristian Grothoff <christian@grothoff.org>2012-01-11 21:11:51 +0000
commit5826f9d6280175acde486a1b02c93197a49396bd (patch)
tree57bab01eff235ae52062b662220a01c9dfad6142 /src/fs/fs_publish.c
parent354a420bc1ddcc46b837a4e99e874195a53b7d57 (diff)
downloadgnunet-5826f9d6280175acde486a1b02c93197a49396bd.tar.gz
gnunet-5826f9d6280175acde486a1b02c93197a49396bd.zip
fixing bug to ensure that we properly descend into deep directories for the various publish start/stop/suspend/resume event callbacks
Diffstat (limited to 'src/fs/fs_publish.c')
-rw-r--r--src/fs/fs_publish.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c
index 05f667451..4ae3264a2 100644
--- a/src/fs/fs_publish.c
+++ b/src/fs/fs_publish.c
@@ -954,6 +954,11 @@ fip_signal_start (void *cls, struct GNUNET_FS_FileInformation *fi,
954 unsigned int kc; 954 unsigned int kc;
955 uint64_t left; 955 uint64_t left;
956 956
957 if (GNUNET_YES == pc->skip_next_fi_callback)
958 {
959 pc->skip_next_fi_callback = GNUNET_NO;
960 return GNUNET_OK;
961 }
957#if DEBUG_PUBLISH 962#if DEBUG_PUBLISH
958 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting publish operation\n"); 963 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting publish operation\n");
959#endif 964#endif
@@ -991,6 +996,12 @@ fip_signal_start (void *cls, struct GNUNET_FS_FileInformation *fi,
991 pi.status = GNUNET_FS_STATUS_PUBLISH_START; 996 pi.status = GNUNET_FS_STATUS_PUBLISH_START;
992 *client_info = GNUNET_FS_publish_make_status_ (&pi, pc, fi, 0); 997 *client_info = GNUNET_FS_publish_make_status_ (&pi, pc, fi, 0);
993 GNUNET_FS_file_information_sync_ (fi); 998 GNUNET_FS_file_information_sync_ (fi);
999 if (GNUNET_YES == GNUNET_FS_meta_data_test_for_directory (meta))
1000 {
1001 /* process entries in directory */
1002 pc->skip_next_fi_callback = GNUNET_YES;
1003 GNUNET_FS_file_information_inspect (fi, &fip_signal_start, pc);
1004 }
994 return GNUNET_OK; 1005 return GNUNET_OK;
995} 1006}
996 1007
@@ -1020,6 +1031,17 @@ fip_signal_suspend (void *cls, struct GNUNET_FS_FileInformation *fi,
1020 struct GNUNET_FS_ProgressInfo pi; 1031 struct GNUNET_FS_ProgressInfo pi;
1021 uint64_t off; 1032 uint64_t off;
1022 1033
1034 if (GNUNET_YES == pc->skip_next_fi_callback)
1035 {
1036 pc->skip_next_fi_callback = GNUNET_NO;
1037 return GNUNET_OK;
1038 }
1039 if (GNUNET_YES == GNUNET_FS_meta_data_test_for_directory (meta))
1040 {
1041 /* process entries in directory */
1042 pc->skip_next_fi_callback = GNUNET_YES;
1043 GNUNET_FS_file_information_inspect (fi, &fip_signal_suspend, pc);
1044 }
1023#if DEBUG_PUBLISH 1045#if DEBUG_PUBLISH
1024 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Suspending publish operation\n"); 1046 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Suspending publish operation\n");
1025#endif 1047#endif
@@ -1204,6 +1226,17 @@ fip_signal_stop (void *cls, struct GNUNET_FS_FileInformation *fi,
1204 struct GNUNET_FS_ProgressInfo pi; 1226 struct GNUNET_FS_ProgressInfo pi;
1205 uint64_t off; 1227 uint64_t off;
1206 1228
1229 if (GNUNET_YES == pc->skip_next_fi_callback)
1230 {
1231 pc->skip_next_fi_callback = GNUNET_NO;
1232 return GNUNET_OK;
1233 }
1234 if (GNUNET_YES == GNUNET_FS_meta_data_test_for_directory (meta))
1235 {
1236 /* process entries in directory first */
1237 pc->skip_next_fi_callback = GNUNET_YES;
1238 GNUNET_FS_file_information_inspect (fi, &fip_signal_stop, pc);
1239 }
1207 if (fi->serialization != NULL) 1240 if (fi->serialization != NULL)
1208 { 1241 {
1209 GNUNET_FS_remove_sync_file_ (pc->h, GNUNET_FS_SYNC_PATH_FILE_INFO, 1242 GNUNET_FS_remove_sync_file_ (pc->h, GNUNET_FS_SYNC_PATH_FILE_INFO,