aboutsummaryrefslogtreecommitdiff
path: root/src/fs/fs_unindex.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-05-03 21:35:44 +0000
committerChristian Grothoff <christian@grothoff.org>2010-05-03 21:35:44 +0000
commit7eb4b4b3ab14ef6433b08cca8c673d00f8405062 (patch)
tree04dfe48fe96a0a8096239b0083f19602b333a998 /src/fs/fs_unindex.c
parent4092583a7dcb0844d5957909ef81f6766b3f2603 (diff)
downloadgnunet-7eb4b4b3ab14ef6433b08cca8c673d00f8405062.tar.gz
gnunet-7eb4b4b3ab14ef6433b08cca8c673d00f8405062.zip
towards suspend
Diffstat (limited to 'src/fs/fs_unindex.c')
-rw-r--r--src/fs/fs_unindex.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/fs/fs_unindex.c b/src/fs/fs_unindex.c
index 4b4e526dd..6d4ee3f54 100644
--- a/src/fs/fs_unindex.c
+++ b/src/fs/fs_unindex.c
@@ -394,6 +394,23 @@ GNUNET_FS_unindex_process_hash_ (void *cls,
394 394
395 395
396/** 396/**
397 * Create SUSPEND event for the given unindex operation
398 * and then clean up our state (without stop signal).
399 *
400 * @param cls the 'struct GNUNET_FS_UnindexContext' to signal for
401 */
402static void
403unindex_signal_suspend (void *cls)
404{
405 struct GNUNET_FS_UnindexContext *uc = cls;
406
407 GNUNET_FS_end_top (uc->h, uc->top);
408 /* FIXME: signal! */
409 GNUNET_free (uc);
410}
411
412
413/**
397 * Unindex a file. 414 * Unindex a file.
398 * 415 *
399 * @param h handle to the file sharing subsystem 416 * @param h handle to the file sharing subsystem
@@ -432,6 +449,9 @@ GNUNET_FS_unindex_start (struct GNUNET_FS_Handle *h,
432 HASHING_BLOCKSIZE, 449 HASHING_BLOCKSIZE,
433 &GNUNET_FS_unindex_process_hash_, 450 &GNUNET_FS_unindex_process_hash_,
434 ret); 451 ret);
452 ret->top = GNUNET_FS_make_top (h,
453 &unindex_signal_suspend,
454 ret);
435 return ret; 455 return ret;
436} 456}
437 457
@@ -446,6 +466,7 @@ GNUNET_FS_unindex_stop (struct GNUNET_FS_UnindexContext *uc)
446{ 466{
447 struct GNUNET_FS_ProgressInfo pi; 467 struct GNUNET_FS_ProgressInfo pi;
448 468
469 GNUNET_FS_end_top (uc->h, uc->top);
449 if ( (uc->state != UNINDEX_STATE_COMPLETE) && 470 if ( (uc->state != UNINDEX_STATE_COMPLETE) &&
450 (uc->state != UNINDEX_STATE_ERROR) ) 471 (uc->state != UNINDEX_STATE_ERROR) )
451 { 472 {