diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-05-26 19:55:24 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-05-26 19:55:24 +0000 |
commit | d0e25cca5eb56a18bd4feddcb4235aff09131a80 (patch) | |
tree | f85aa9dacc43f4528daf7c417b61e2506700df83 /src/fs/gnunet-service-fs_indexing.c | |
parent | 95c050064311c6153a5312da89d3a076617141b5 (diff) | |
download | gnunet-d0e25cca5eb56a18bd4feddcb4235aff09131a80.tar.gz gnunet-d0e25cca5eb56a18bd4feddcb4235aff09131a80.zip |
change unindex processing order to avoid transient dangling DB entries
Diffstat (limited to 'src/fs/gnunet-service-fs_indexing.c')
-rw-r--r-- | src/fs/gnunet-service-fs_indexing.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/fs/gnunet-service-fs_indexing.c b/src/fs/gnunet-service-fs_indexing.c index 39999be75..808f56a2c 100644 --- a/src/fs/gnunet-service-fs_indexing.c +++ b/src/fs/gnunet-service-fs_indexing.c | |||
@@ -206,7 +206,6 @@ read_index_list () | |||
206 | GNUNET_free (fn); | 206 | GNUNET_free (fn); |
207 | return; | 207 | return; |
208 | } | 208 | } |
209 | |||
210 | while ( (GNUNET_OK == | 209 | while ( (GNUNET_OK == |
211 | GNUNET_BIO_read (rh, | 210 | GNUNET_BIO_read (rh, |
212 | "Hash of indexed file", | 211 | "Hash of indexed file", |
@@ -478,7 +477,7 @@ GNUNET_FS_handle_unindex (void *cls, | |||
478 | struct IndexInfo *next; | 477 | struct IndexInfo *next; |
479 | struct GNUNET_SERVER_TransmitContext *tc; | 478 | struct GNUNET_SERVER_TransmitContext *tc; |
480 | int found; | 479 | int found; |
481 | 480 | ||
482 | um = (const struct UnindexMessage*) message; | 481 | um = (const struct UnindexMessage*) message; |
483 | found = GNUNET_NO; | 482 | found = GNUNET_NO; |
484 | prev = NULL; | 483 | prev = NULL; |
@@ -494,6 +493,10 @@ GNUNET_FS_handle_unindex (void *cls, | |||
494 | indexed_files = next; | 493 | indexed_files = next; |
495 | else | 494 | else |
496 | prev->next = next; | 495 | prev->next = next; |
496 | GNUNET_break (GNUNET_OK == | ||
497 | GNUNET_CONTAINER_multihashmap_remove (ifm, | ||
498 | &pos->file_id, | ||
499 | (void*) pos->filename)); | ||
497 | GNUNET_free (pos); | 500 | GNUNET_free (pos); |
498 | found = GNUNET_YES; | 501 | found = GNUNET_YES; |
499 | } | 502 | } |
@@ -621,7 +624,7 @@ GNUNET_FS_handle_on_demand_block (const GNUNET_HashCode * key, | |||
621 | GNUNET_h2s (&odb->file_id), | 624 | GNUNET_h2s (&odb->file_id), |
622 | fn, | 625 | fn, |
623 | (unsigned long long) off, | 626 | (unsigned long long) off, |
624 | STRERROR (errno)); | 627 | (fn == NULL) ? _("not indexed") : STRERROR (errno)); |
625 | if (fh != NULL) | 628 | if (fh != NULL) |
626 | GNUNET_DISK_file_close (fh); | 629 | GNUNET_DISK_file_close (fh); |
627 | GNUNET_DATASTORE_remove (dsh, | 630 | GNUNET_DATASTORE_remove (dsh, |