diff options
Diffstat (limited to 'src/fs/fs_dirmetascan.c')
-rw-r--r-- | src/fs/fs_dirmetascan.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/src/fs/fs_dirmetascan.c b/src/fs/fs_dirmetascan.c index 8a3e37b49..e904b9092 100644 --- a/src/fs/fs_dirmetascan.c +++ b/src/fs/fs_dirmetascan.c | |||
@@ -211,9 +211,9 @@ expand_tree (struct GNUNET_FS_ShareTreeItem *parent, | |||
211 | chld->short_filename[slen-1] = '\0'; | 211 | chld->short_filename[slen-1] = '\0'; |
212 | chld->is_directory = is_directory; | 212 | chld->is_directory = is_directory; |
213 | if (NULL != parent) | 213 | if (NULL != parent) |
214 | GNUNET_CONTAINER_DLL_insert (parent->children_head, | 214 | GNUNET_CONTAINER_DLL_insert (parent->children_head, |
215 | parent->children_tail, | 215 | parent->children_tail, |
216 | chld); | 216 | chld); |
217 | return chld; | 217 | return chld; |
218 | } | 218 | } |
219 | 219 | ||
@@ -259,7 +259,8 @@ process_helper_msgs (void *cls, | |||
259 | size_t left; | 259 | size_t left; |
260 | 260 | ||
261 | #if 0 | 261 | #if 0 |
262 | fprintf (stderr, "DMS parses %u-byte message of type %u\n", | 262 | fprintf (stderr, |
263 | "DMS parses %u-byte message of type %u\n", | ||
263 | (unsigned int) ntohs (msg->size), | 264 | (unsigned int) ntohs (msg->size), |
264 | (unsigned int) ntohs (msg->type)); | 265 | (unsigned int) ntohs (msg->type)); |
265 | #endif | 266 | #endif |
@@ -277,11 +278,18 @@ process_helper_msgs (void *cls, | |||
277 | filename, GNUNET_NO, | 278 | filename, GNUNET_NO, |
278 | GNUNET_FS_DIRSCANNER_FILE_START); | 279 | GNUNET_FS_DIRSCANNER_FILE_START); |
279 | if (NULL == ds->toplevel) | 280 | if (NULL == ds->toplevel) |
281 | { | ||
280 | ds->toplevel = expand_tree (ds->pos, | 282 | ds->toplevel = expand_tree (ds->pos, |
281 | filename, GNUNET_NO); | 283 | filename, |
284 | GNUNET_NO); | ||
285 | } | ||
282 | else | 286 | else |
287 | { | ||
288 | GNUNET_assert (NULL != ds->pos); | ||
283 | (void) expand_tree (ds->pos, | 289 | (void) expand_tree (ds->pos, |
284 | filename, GNUNET_NO); | 290 | filename, |
291 | GNUNET_NO); | ||
292 | } | ||
285 | return GNUNET_OK; | 293 | return GNUNET_OK; |
286 | case GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_PROGRESS_DIRECTORY: | 294 | case GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_PROGRESS_DIRECTORY: |
287 | if (filename[left-1] != '\0') | 295 | if (filename[left-1] != '\0') |
@@ -303,7 +311,8 @@ process_helper_msgs (void *cls, | |||
303 | filename, GNUNET_YES, | 311 | filename, GNUNET_YES, |
304 | GNUNET_FS_DIRSCANNER_FILE_START); | 312 | GNUNET_FS_DIRSCANNER_FILE_START); |
305 | ds->pos = expand_tree (ds->pos, | 313 | ds->pos = expand_tree (ds->pos, |
306 | filename, GNUNET_YES); | 314 | filename, |
315 | GNUNET_YES); | ||
307 | if (NULL == ds->toplevel) | 316 | if (NULL == ds->toplevel) |
308 | ds->toplevel = ds->pos; | 317 | ds->toplevel = ds->pos; |
309 | return GNUNET_OK; | 318 | return GNUNET_OK; |
@@ -360,11 +369,13 @@ process_helper_msgs (void *cls, | |||
360 | break; | 369 | break; |
361 | } | 370 | } |
362 | ds->progress_callback (ds->progress_callback_cls, | 371 | ds->progress_callback (ds->progress_callback_cls, |
363 | filename, GNUNET_YES, | 372 | filename, |
373 | GNUNET_YES, | ||
364 | GNUNET_FS_DIRSCANNER_EXTRACT_FINISHED); | 374 | GNUNET_FS_DIRSCANNER_EXTRACT_FINISHED); |
365 | if (0 < left) | 375 | if (0 < left) |
366 | { | 376 | { |
367 | ds->pos->meta = GNUNET_CONTAINER_meta_data_deserialize (end, left); | 377 | ds->pos->meta = GNUNET_CONTAINER_meta_data_deserialize (end, |
378 | left); | ||
368 | if (NULL == ds->pos->meta) | 379 | if (NULL == ds->pos->meta) |
369 | { | 380 | { |
370 | GNUNET_break (0); | 381 | GNUNET_break (0); |