aboutsummaryrefslogtreecommitdiff
path: root/src/fs/fs_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-08-06 20:46:22 +0000
committerChristian Grothoff <christian@grothoff.org>2013-08-06 20:46:22 +0000
commit303ab4dafbc680b1b362f95df5b12dae831b1593 (patch)
tree8b2f411b0b31e500ce2988404b2501db03bed945 /src/fs/fs_api.c
parent1360f8a1e5877a8796dc8e7d0c55d78481382e80 (diff)
downloadgnunet-303ab4dafbc680b1b362f95df5b12dae831b1593.tar.gz
gnunet-303ab4dafbc680b1b362f95df5b12dae831b1593.zip
-fixing main FS build, updating man page of gnunet-pseudonym
Diffstat (limited to 'src/fs/fs_api.c')
-rw-r--r--src/fs/fs_api.c35
1 files changed, 16 insertions, 19 deletions
diff --git a/src/fs/fs_api.c b/src/fs/fs_api.c
index ab49139b9..9676f2e3c 100644
--- a/src/fs/fs_api.c
+++ b/src/fs/fs_api.c
@@ -1467,17 +1467,17 @@ deserialize_publish_file (void *cls, const char *filename)
1467 struct GNUNET_FS_PublishContext *pc; 1467 struct GNUNET_FS_PublishContext *pc;
1468 int32_t options; 1468 int32_t options;
1469 int32_t all_done; 1469 int32_t all_done;
1470 int32_t have_ns;
1470 char *fi_root; 1471 char *fi_root;
1471 char *ns; 1472 struct GNUNET_CRYPTO_EccPrivateKey ns;
1472 char *fi_pos; 1473 char *fi_pos;
1473 char *emsg; 1474 char *emsg;
1474 1475
1475 pc = GNUNET_malloc (sizeof (struct GNUNET_FS_PublishContext)); 1476 pc = GNUNET_new (struct GNUNET_FS_PublishContext);
1476 pc->h = h; 1477 pc->h = h;
1477 pc->serialization = get_serialization_short_name (filename); 1478 pc->serialization = get_serialization_short_name (filename);
1478 fi_root = NULL; 1479 fi_root = NULL;
1479 fi_pos = NULL; 1480 fi_pos = NULL;
1480 ns = NULL;
1481 rh = GNUNET_BIO_read_open (filename); 1481 rh = GNUNET_BIO_read_open (filename);
1482 if (NULL == rh) 1482 if (NULL == rh)
1483 { 1483 {
@@ -1489,10 +1489,12 @@ deserialize_publish_file (void *cls, const char *filename)
1489 GNUNET_BIO_read_string (rh, "publish-nuid", &pc->nuid, 1024)) || 1489 GNUNET_BIO_read_string (rh, "publish-nuid", &pc->nuid, 1024)) ||
1490 (GNUNET_OK != GNUNET_BIO_read_int32 (rh, &options)) || 1490 (GNUNET_OK != GNUNET_BIO_read_int32 (rh, &options)) ||
1491 (GNUNET_OK != GNUNET_BIO_read_int32 (rh, &all_done)) || 1491 (GNUNET_OK != GNUNET_BIO_read_int32 (rh, &all_done)) ||
1492 (GNUNET_OK != GNUNET_BIO_read_int32 (rh, &have_ns)) ||
1492 (GNUNET_OK != 1493 (GNUNET_OK !=
1493 GNUNET_BIO_read_string (rh, "publish-firoot", &fi_root, 128)) || 1494 GNUNET_BIO_read_string (rh, "publish-firoot", &fi_root, 128)) ||
1494 (GNUNET_OK != GNUNET_BIO_read_string (rh, "publish-fipos", &fi_pos, 128)) 1495 (GNUNET_OK != GNUNET_BIO_read_string (rh, "publish-fipos", &fi_pos, 128))
1495 || (GNUNET_OK != GNUNET_BIO_read_string (rh, "publish-ns", &ns, 1024))) 1496 || ( (GNUNET_YES == have_ns) &&
1497 (GNUNET_OK != GNUNET_BIO_read (rh, "publish-ns", &ns, sizeof (ns)))) )
1496 { 1498 {
1497 GNUNET_break (0); 1499 GNUNET_break (0);
1498 goto cleanup; 1500 goto cleanup;
@@ -1510,17 +1512,10 @@ deserialize_publish_file (void *cls, const char *filename)
1510 GNUNET_break (0); 1512 GNUNET_break (0);
1511 goto cleanup; 1513 goto cleanup;
1512 } 1514 }
1513 if (NULL != ns) 1515 if (GNUNET_YES == have_ns)
1514 { 1516 {
1515 pc->ns = GNUNET_FS_namespace_create (h, ns); 1517 pc->ns = GNUNET_new (struct GNUNET_CRYPTO_EccPrivateKey);
1516 if (NULL == pc->ns) 1518 *pc->ns = ns;
1517 {
1518 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
1519 _
1520 ("Failed to recover namespace `%s', cannot resume publishing operation.\n"),
1521 ns);
1522 goto cleanup;
1523 }
1524 } 1519 }
1525 if ((0 == (pc->options & GNUNET_FS_PUBLISH_OPTION_SIMULATE_ONLY)) && 1520 if ((0 == (pc->options & GNUNET_FS_PUBLISH_OPTION_SIMULATE_ONLY)) &&
1526 (GNUNET_YES != pc->all_done)) 1521 (GNUNET_YES != pc->all_done))
@@ -1563,7 +1558,6 @@ deserialize_publish_file (void *cls, const char *filename)
1563 filename, emsg); 1558 filename, emsg);
1564 GNUNET_free (emsg); 1559 GNUNET_free (emsg);
1565 } 1560 }
1566 GNUNET_free_non_null (ns);
1567 pc->top = GNUNET_FS_make_top (h, &GNUNET_FS_publish_signal_suspend_, pc); 1561 pc->top = GNUNET_FS_make_top (h, &GNUNET_FS_publish_signal_suspend_, pc);
1568 return GNUNET_OK; 1562 return GNUNET_OK;
1569cleanup: 1563cleanup:
@@ -1571,7 +1565,6 @@ cleanup:
1571 GNUNET_free_non_null (pc->nuid); 1565 GNUNET_free_non_null (pc->nuid);
1572 GNUNET_free_non_null (fi_root); 1566 GNUNET_free_non_null (fi_root);
1573 GNUNET_free_non_null (fi_pos); 1567 GNUNET_free_non_null (fi_pos);
1574 GNUNET_free_non_null (ns);
1575 if ((NULL != rh) && (GNUNET_OK != GNUNET_BIO_read_close (rh, &emsg))) 1568 if ((NULL != rh) && (GNUNET_OK != GNUNET_BIO_read_close (rh, &emsg)))
1576 { 1569 {
1577 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 1570 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
@@ -1601,6 +1594,7 @@ void
1601GNUNET_FS_publish_sync_ (struct GNUNET_FS_PublishContext *pc) 1594GNUNET_FS_publish_sync_ (struct GNUNET_FS_PublishContext *pc)
1602{ 1595{
1603 struct GNUNET_BIO_WriteHandle *wh; 1596 struct GNUNET_BIO_WriteHandle *wh;
1597 int32_t have_ns;
1604 1598
1605 if (NULL == pc->serialization) 1599 if (NULL == pc->serialization)
1606 pc->serialization = 1600 pc->serialization =
@@ -1622,17 +1616,20 @@ GNUNET_FS_publish_sync_ (struct GNUNET_FS_PublishContext *pc)
1622 GNUNET_break (0); 1616 GNUNET_break (0);
1623 goto cleanup; 1617 goto cleanup;
1624 } 1618 }
1619 have_ns = (NULL != pc->ns) ? GNUNET_YES : GNUNET_NO;
1625 if ((GNUNET_OK != GNUNET_BIO_write_string (wh, pc->nid)) || 1620 if ((GNUNET_OK != GNUNET_BIO_write_string (wh, pc->nid)) ||
1626 (GNUNET_OK != GNUNET_BIO_write_string (wh, pc->nuid)) || 1621 (GNUNET_OK != GNUNET_BIO_write_string (wh, pc->nuid)) ||
1627 (GNUNET_OK != GNUNET_BIO_write_int32 (wh, pc->options)) || 1622 (GNUNET_OK != GNUNET_BIO_write_int32 (wh, pc->options)) ||
1628 (GNUNET_OK != GNUNET_BIO_write_int32 (wh, pc->all_done)) || 1623 (GNUNET_OK != GNUNET_BIO_write_int32 (wh, pc->all_done)) ||
1624 (GNUNET_OK != GNUNET_BIO_write_int32 (wh, have_ns)) ||
1629 (GNUNET_OK != GNUNET_BIO_write_string (wh, pc->fi->serialization)) || 1625 (GNUNET_OK != GNUNET_BIO_write_string (wh, pc->fi->serialization)) ||
1630 (GNUNET_OK != 1626 (GNUNET_OK !=
1631 GNUNET_BIO_write_string (wh, 1627 GNUNET_BIO_write_string (wh,
1632 (NULL == pc->fi_pos) ? NULL : pc->fi_pos->serialization)) || 1628 (NULL == pc->fi_pos) ? NULL : pc->fi_pos->serialization)) ||
1633 (GNUNET_OK != 1629 ( (NULL != pc->ns) &&
1634 GNUNET_BIO_write_string (wh, 1630 GNUNET_BIO_write (wh,
1635 (NULL == pc->ns) ? NULL : pc->ns->name))) 1631 pc->ns,
1632 sizeof (struct GNUNET_CRYPTO_EccPrivateKey)) ) )
1636 { 1633 {
1637 GNUNET_break (0); 1634 GNUNET_break (0);
1638 goto cleanup; 1635 goto cleanup;