aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-publish.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/gnunet-publish.c')
-rw-r--r--src/fs/gnunet-publish.c47
1 files changed, 41 insertions, 6 deletions
diff --git a/src/fs/gnunet-publish.c b/src/fs/gnunet-publish.c
index 860a81522..1e0884361 100644
--- a/src/fs/gnunet-publish.c
+++ b/src/fs/gnunet-publish.c
@@ -24,9 +24,6 @@
24 * @author Krista Bennett 24 * @author Krista Bennett
25 * @author James Blackwell 25 * @author James Blackwell
26 * @author Igor Wronsky 26 * @author Igor Wronsky
27 *
28 * TODO:
29 * - support for some options is still missing (uri argument)
30 */ 27 */
31#include "platform.h" 28#include "platform.h"
32#include "gnunet_fs_service.h" 29#include "gnunet_fs_service.h"
@@ -307,6 +304,22 @@ publish_inspector (void *cls,
307} 304}
308 305
309 306
307static void
308uri_ksk_continuation (void *cls,
309 const struct GNUNET_FS_Uri *uri,
310 const char *emsg)
311{
312 if (emsg != NULL)
313 {
314 fprintf (stderr,
315 "%s\n",
316 emsg);
317 ret = 1;
318 }
319 GNUNET_FS_stop (ctx);
320}
321
322
310/** 323/**
311 * Main function that will be run by the scheduler. 324 * Main function that will be run by the scheduler.
312 * 325 *
@@ -329,6 +342,7 @@ run (void *cls,
329 struct stat sbuf; 342 struct stat sbuf;
330 char *ex; 343 char *ex;
331 char *emsg; 344 char *emsg;
345 struct GNUNET_FS_Uri *uri;
332 346
333 sched = s; 347 sched = s;
334 /* check arguments */ 348 /* check arguments */
@@ -421,11 +435,32 @@ run (void *cls,
421 } 435 }
422 } 436 }
423 if (NULL != uri_string) 437 if (NULL != uri_string)
424 { 438 {
425 // FIXME -- implement! 439 emsg = NULL;
440 uri = GNUNET_FS_uri_parse (uri_string,
441 &emsg);
442 if (uri == NULL)
443 {
444 fprintf (stderr,
445 _("Failed to parse URI: %s\n"),
446 emsg);
447 GNUNET_free (emsg);
448 GNUNET_FS_stop (ctx);
449 ret = 1;
450 return;
451 }
452 GNUNET_FS_publish_ksk (ctx,
453 topKeywords,
454 meta,
455 uri,
456 GNUNET_TIME_relative_to_absolute (DEFAULT_EXPIRATION),
457 anonymity,
458 priority,
459 GNUNET_FS_PUBLISH_OPTION_NONE,
460 &uri_ksk_continuation,
461 NULL);
426 return; 462 return;
427 } 463 }
428
429 l = NULL; 464 l = NULL;
430 if (! disable_extractor) 465 if (! disable_extractor)
431 { 466 {