aboutsummaryrefslogtreecommitdiff
path: root/src/fs/fs_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-09-13 19:46:45 +0000
committerChristian Grothoff <christian@grothoff.org>2013-09-13 19:46:45 +0000
commite5ba359af49fac05185f5ec0b4dbb47c7060167a (patch)
treec8146873eb3676714f2c370c067f5b7164146918 /src/fs/fs_api.c
parentae202e69cb8d882992cac472a2fd86da0d0b18bf (diff)
downloadgnunet-e5ba359af49fac05185f5ec0b4dbb47c7060167a.tar.gz
gnunet-e5ba359af49fac05185f5ec0b4dbb47c7060167a.zip
-fixing resuming publish operation
Diffstat (limited to 'src/fs/fs_api.c')
-rw-r--r--src/fs/fs_api.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/fs/fs_api.c b/src/fs/fs_api.c
index be351b279..e5707c804 100644
--- a/src/fs/fs_api.c
+++ b/src/fs/fs_api.c
@@ -1187,7 +1187,7 @@ make_serialization_file_name_in_dir (struct GNUNET_FS_Handle *h,
1187 * 1187 *
1188 * @param wh write handle 1188 * @param wh write handle
1189 * @param fi file with reader 1189 * @param fi file with reader
1190 * @return GNUNET_OK on success 1190 * @return #GNUNET_OK on success
1191 */ 1191 */
1192static int 1192static int
1193copy_from_reader (struct GNUNET_BIO_WriteHandle *wh, 1193copy_from_reader (struct GNUNET_BIO_WriteHandle *wh,
@@ -1330,6 +1330,9 @@ GNUNET_FS_file_information_sync_ (struct GNUNET_FS_FileInformation *fi)
1330 } 1330 }
1331 break; 1331 break;
1332 case 4: /* directory */ 1332 case 4: /* directory */
1333 if ( (NULL != fi->data.dir.entries) &&
1334 (NULL == fi->data.dir.entries->serialization) )
1335 GNUNET_FS_file_information_sync_ (fi->data.dir.entries);
1333 if ((GNUNET_OK != GNUNET_BIO_write_int32 (wh, fi->data.dir.dir_size)) || 1336 if ((GNUNET_OK != GNUNET_BIO_write_int32 (wh, fi->data.dir.dir_size)) ||
1334 (GNUNET_OK != 1337 (GNUNET_OK !=
1335 GNUNET_BIO_write (wh, fi->data.dir.dir_data, 1338 GNUNET_BIO_write (wh, fi->data.dir.dir_data,
@@ -1348,6 +1351,9 @@ GNUNET_FS_file_information_sync_ (struct GNUNET_FS_FileInformation *fi)
1348 GNUNET_assert (0); 1351 GNUNET_assert (0);
1349 goto cleanup; 1352 goto cleanup;
1350 } 1353 }
1354 if ( (NULL != fi->next) &&
1355 (NULL == fi->next->serialization) )
1356 GNUNET_FS_file_information_sync_ (fi->next);
1351 if (GNUNET_OK != 1357 if (GNUNET_OK !=
1352 GNUNET_BIO_write_string (wh, 1358 GNUNET_BIO_write_string (wh,
1353 (fi->next != 1359 (fi->next !=
@@ -1398,9 +1404,6 @@ find_file_position (struct GNUNET_FS_FileInformation *pos,
1398 1404
1399 while (NULL != pos) 1405 while (NULL != pos)
1400 { 1406 {
1401 fprintf (stderr,
1402 "CMP: %s %s\n",
1403 srch, pos->serialization);
1404 if (0 == strcmp (srch, pos->serialization)) 1407 if (0 == strcmp (srch, pos->serialization))
1405 return pos; 1408 return pos;
1406 if ( (GNUNET_YES == pos->is_directory) && 1409 if ( (GNUNET_YES == pos->is_directory) &&
@@ -1416,7 +1419,7 @@ find_file_position (struct GNUNET_FS_FileInformation *pos,
1416 * Signal the FS's progress function that we are resuming 1419 * Signal the FS's progress function that we are resuming
1417 * an upload. 1420 * an upload.
1418 * 1421 *
1419 * @param cls closure (of type "struct GNUNET_FS_PublishContext*") 1422 * @param cls closure (of type `struct GNUNET_FS_PublishContext *`, for the parent (!))
1420 * @param fi the entry in the publish-structure 1423 * @param fi the entry in the publish-structure
1421 * @param length length of the file or directory 1424 * @param length length of the file or directory
1422 * @param meta metadata for the file or directory (can be modified) 1425 * @param meta metadata for the file or directory (can be modified)
@@ -1424,7 +1427,7 @@ find_file_position (struct GNUNET_FS_FileInformation *pos,
1424 * @param bo block options (can be modified) 1427 * @param bo block options (can be modified)
1425 * @param do_index should we index? 1428 * @param do_index should we index?
1426 * @param client_info pointer to client context set upon creation (can be modified) 1429 * @param client_info pointer to client context set upon creation (can be modified)
1427 * @return GNUNET_OK to continue (always) 1430 * @return #GNUNET_OK to continue (always)
1428 */ 1431 */
1429static int 1432static int
1430fip_signal_resume (void *cls, struct GNUNET_FS_FileInformation *fi, 1433fip_signal_resume (void *cls, struct GNUNET_FS_FileInformation *fi,
@@ -1442,8 +1445,8 @@ fip_signal_resume (void *cls, struct GNUNET_FS_FileInformation *fi,
1442 return GNUNET_OK; 1445 return GNUNET_OK;
1443 } 1446 }
1444 pi.status = GNUNET_FS_STATUS_PUBLISH_RESUME; 1447 pi.status = GNUNET_FS_STATUS_PUBLISH_RESUME;
1445 pi.value.publish.specifics.resume.message = pc->fi->emsg; 1448 pi.value.publish.specifics.resume.message = fi->emsg;
1446 pi.value.publish.specifics.resume.chk_uri = pc->fi->chk_uri; 1449 pi.value.publish.specifics.resume.chk_uri = fi->chk_uri;
1447 *client_info = GNUNET_FS_publish_make_status_ (&pi, pc, fi, 0); 1450 *client_info = GNUNET_FS_publish_make_status_ (&pi, pc, fi, 0);
1448 if (GNUNET_YES == GNUNET_FS_meta_data_test_for_directory (meta)) 1451 if (GNUNET_YES == GNUNET_FS_meta_data_test_for_directory (meta))
1449 { 1452 {
@@ -1459,7 +1462,7 @@ fip_signal_resume (void *cls, struct GNUNET_FS_FileInformation *fi,
1459 * Function called with a filename of serialized publishing operation 1462 * Function called with a filename of serialized publishing operation
1460 * to deserialize. 1463 * to deserialize.
1461 * 1464 *
1462 * @param cls the 'struct GNUNET_FS_Handle*' 1465 * @param cls the `struct GNUNET_FS_Handle *`
1463 * @param filename complete filename (absolute path) 1466 * @param filename complete filename (absolute path)
1464 * @return #GNUNET_OK (continue to iterate) 1467 * @return #GNUNET_OK (continue to iterate)
1465 */ 1468 */