code clean up
[oweals/gnunet.git] / src / fs / gnunet-service-fs_indexing.c
1 /*
2      This file is part of GNUnet.
3      (C) 2009, 2010 Christian Grothoff (and other contributing authors)
4
5      GNUnet is free software; you can redistribute it and/or modify
6      it under the terms of the GNU General Public License as published
7      by the Free Software Foundation; either version 2, or (at your
8      option) any later version.
9
10      GNUnet is distributed in the hope that it will be useful, but
11      WITHOUT ANY WARRANTY; without even the implied warranty of
12      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13      General Public License for more details.
14
15      You should have received a copy of the GNU General Public License
16      along with GNUnet; see the file COPYING.  If not, write to the
17      Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18      Boston, MA 02111-1307, USA.
19 */
20
21 /**
22  * @file fs/gnunet-service-fs_indexing.c
23  * @brief program that provides indexing functions of the file-sharing service
24  * @author Christian Grothoff
25  *
26  * TODO:
27  * - consider doing GNUNET_CRYPTO_hash_file_cancel on active indexing
28  *   jobs during shutdown (currently, shutdown will only happen after
29  *   all of those are done, not sure if this is good or bad)
30  */
31 #include "platform.h"
32 #include <float.h>
33 #include "gnunet_core_service.h"
34 #include "gnunet_datastore_service.h"
35 #include "gnunet_peer_lib.h"
36 #include "gnunet_protocols.h"
37 #include "gnunet_signatures.h"
38 #include "gnunet_util_lib.h"
39 #include "gnunet-service-fs_drq.h"
40 #include "gnunet-service-fs_indexing.h"
41 #include "fs.h"
42
43 #define DEBUG_FS GNUNET_NO
44
45 /**
46  * In-memory information about indexed files (also available
47  * on-disk).
48  */
49 struct IndexInfo
50 {
51   
52   /**
53    * This is a linked list.
54    */
55   struct IndexInfo *next;
56
57   /**
58    * Name of the indexed file.  Memory allocated
59    * at the end of this struct (do not free).
60    */
61   const char *filename;
62
63   /**
64    * Context for transmitting confirmation to client,
65    * NULL if we've done this already.
66    */
67   struct GNUNET_SERVER_TransmitContext *tc;
68
69   /**
70    * Context for hashing of the file.
71    */
72   struct GNUNET_CRYPTO_FileHashContext *fhc;
73   
74   /**
75    * Hash of the contents of the file.
76    */
77   GNUNET_HashCode file_id;
78
79 };
80
81
82 /**
83  * Linked list of indexed files.
84  */
85 static struct IndexInfo *indexed_files;
86
87 /**
88  * Maps hash over content of indexed files to the respective filename.
89  * The filenames are pointers into the indexed_files linked list and
90  * do not need to be freed.
91  */
92 static struct GNUNET_CONTAINER_MultiHashMap *ifm;
93
94 /**
95  * Our scheduler.
96  */
97 static struct GNUNET_SCHEDULER_Handle *sched;
98
99 /**
100  * Our configuration.
101  */
102 static const struct GNUNET_CONFIGURATION_Handle *cfg;
103
104 /**
105  * Datastore handle.  Created and destroyed by code in
106  * gnunet-service-fs (this is an alias).
107  */
108 static struct GNUNET_DATASTORE_Handle *dsh;
109
110
111 /**
112  * Write the current index information list to disk.
113  */ 
114 static void
115 write_index_list ()
116 {
117   struct GNUNET_BIO_WriteHandle *wh;
118   char *fn;
119   struct IndexInfo *pos;  
120
121   if (GNUNET_OK !=
122       GNUNET_CONFIGURATION_get_value_filename (cfg,
123                                                "FS",
124                                                "INDEXDB",
125                                                &fn))
126     {
127       GNUNET_log (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
128                   _("Configuration option `%s' in section `%s' missing.\n"),
129                   "INDEXDB",
130                   "FS");
131       return;
132     }
133   wh = GNUNET_BIO_write_open (fn);
134   if (NULL == wh)
135     {
136       GNUNET_log (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
137                   _("Could not open `%s'.\n"),
138                   fn);
139       GNUNET_free (fn);
140       return;
141     }
142   pos = indexed_files;
143   while (pos != NULL)
144     {
145       if ( (GNUNET_OK !=
146             GNUNET_BIO_write (wh,
147                               &pos->file_id,
148                               sizeof (GNUNET_HashCode))) ||
149            (GNUNET_OK !=
150             GNUNET_BIO_write_string (wh,
151                                      pos->filename)) )
152         break;
153       pos = pos->next;
154     }
155   if (GNUNET_OK != 
156       GNUNET_BIO_write_close (wh))
157     {
158       GNUNET_log (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
159                   _("Error writing `%s'.\n"),
160                   fn);
161       GNUNET_free (fn);
162       return;
163     }
164   GNUNET_free (fn);
165 }
166
167
168 /**
169  * Read index information from disk.
170  */
171 static void
172 read_index_list ()
173 {
174   struct GNUNET_BIO_ReadHandle *rh;
175   char *fn;
176   struct IndexInfo *pos;  
177   char *fname;
178   GNUNET_HashCode hc;
179   size_t slen;
180   char *emsg;
181
182   if (GNUNET_OK !=
183       GNUNET_CONFIGURATION_get_value_filename (cfg,
184                                                "FS",
185                                                "INDEXDB",
186                                                &fn))
187     {
188       GNUNET_log (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
189                   _("Configuration option `%s' in section `%s' missing.\n"),
190                   "INDEXDB",
191                   "FS");
192       return;
193     }
194   if (GNUNET_NO == GNUNET_DISK_file_test (fn))
195     {
196       /* no index info yet */
197       GNUNET_free (fn);
198       return;
199     }
200   rh = GNUNET_BIO_read_open (fn);
201   if (NULL == rh)
202     {
203       GNUNET_log (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
204                   _("Could not open `%s'.\n"),
205                   fn);
206       GNUNET_free (fn);
207       return;
208     }
209   while ( (GNUNET_OK ==
210            GNUNET_BIO_read (rh,
211                             "Hash of indexed file",
212                             &hc,
213                             sizeof (GNUNET_HashCode))) &&
214           (GNUNET_OK ==
215            GNUNET_BIO_read_string (rh, 
216                                    "Name of indexed file",
217                                    &fname,
218                                    1024 * 16)) )
219     {
220       slen = strlen (fname) + 1;
221       pos = GNUNET_malloc (sizeof (struct IndexInfo) + slen);
222       pos->file_id = hc;
223       pos->filename = (const char *) &pos[1];
224       memcpy (&pos[1], fname, slen);
225       if (GNUNET_SYSERR ==
226           GNUNET_CONTAINER_multihashmap_put (ifm,
227                                              &hc,
228                                              (void*) pos->filename,
229                                              GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY))
230         {
231           GNUNET_free (pos);
232         }
233       else
234         {
235           pos->next = indexed_files;
236           indexed_files = pos;
237         }
238       GNUNET_free (fname);
239     }
240   if (GNUNET_OK != 
241       GNUNET_BIO_read_close (rh, &emsg))
242     GNUNET_free (emsg);
243   GNUNET_free (fn);
244 }
245
246
247 /**
248  * We've validated the hash of the file we're about to index.  Signal
249  * success to the client and update our internal data structures.
250  *
251  * @param ii the index info entry for the request
252  */
253 static void
254 signal_index_ok (struct IndexInfo *ii)
255 {
256   if (GNUNET_SYSERR ==
257       GNUNET_CONTAINER_multihashmap_put (ifm,
258                                          &ii->file_id,
259                                          (void*) ii->filename,
260                                          GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY))
261     {
262       GNUNET_log (GNUNET_ERROR_TYPE_INFO,
263                   _("Index request received for file `%s' is already indexed as `%s'.  Permitting anyway.\n"),
264                   ii->filename,
265                   (const char*) GNUNET_CONTAINER_multihashmap_get (ifm,
266                                                                    &ii->file_id));
267       GNUNET_SERVER_transmit_context_append_data (ii->tc,
268                                                   NULL, 0,
269                                                   GNUNET_MESSAGE_TYPE_FS_INDEX_START_OK);
270       GNUNET_SERVER_transmit_context_run (ii->tc,
271                                           GNUNET_TIME_UNIT_MINUTES);
272       GNUNET_free (ii);
273       return;
274     }
275   ii->next = indexed_files;
276   indexed_files = ii;
277   write_index_list ();
278   GNUNET_SERVER_transmit_context_append_data (ii->tc,
279                                               NULL, 0,
280                                               GNUNET_MESSAGE_TYPE_FS_INDEX_START_OK);
281   GNUNET_SERVER_transmit_context_run (ii->tc,
282                                       GNUNET_TIME_UNIT_MINUTES);
283   ii->tc = NULL;
284 }
285
286
287 /**
288  * Function called once the hash computation over an
289  * indexed file has completed.
290  *
291  * @param cls closure, our publishing context
292  * @param res resulting hash, NULL on error
293  */
294 static void 
295 hash_for_index_val (void *cls,
296                     const GNUNET_HashCode *
297                     res)
298 {
299   struct IndexInfo *ii = cls;
300
301   ii->fhc = NULL;
302   if ( (res == NULL) ||
303        (0 != memcmp (res,
304                      &ii->file_id,
305                      sizeof(GNUNET_HashCode))) )
306     {
307       GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
308                   _("Hash mismatch trying to index file `%s' which has hash `%s'\n"),
309                   ii->filename,
310                   GNUNET_h2s (res));
311 #if DEBUG_FS
312       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
313                   "Wanted `%s'\n",
314                   GNUNET_h2s (&ii->file_id));
315 #endif
316       GNUNET_SERVER_transmit_context_append_data (ii->tc,
317                                                   NULL, 0,
318                                                   GNUNET_MESSAGE_TYPE_FS_INDEX_START_FAILED);
319       GNUNET_SERVER_transmit_context_run (ii->tc,
320                                           GNUNET_TIME_UNIT_MINUTES);
321       GNUNET_free (ii);
322       return;
323     }
324   signal_index_ok (ii);
325 }
326
327
328 /**
329  * Handle INDEX_START-message.
330  *
331  * @param cls closure
332  * @param client identification of the client
333  * @param message the actual message
334  */
335 void
336 GNUNET_FS_handle_index_start (void *cls,
337                               struct GNUNET_SERVER_Client *client,
338                               const struct GNUNET_MessageHeader *message)
339 {
340   const struct IndexStartMessage *ism;
341   char *fn;
342   uint16_t msize;
343   struct IndexInfo *ii;
344   size_t slen;
345   uint32_t dev;
346   uint64_t ino;
347   uint32_t mydev;
348   uint64_t myino;
349
350   msize = ntohs(message->size);
351   if ( (msize <= sizeof (struct IndexStartMessage)) ||
352        ( ((const char *)message)[msize-1] != '\0') )
353     {
354       GNUNET_break (0);
355       GNUNET_SERVER_receive_done (client,
356                                   GNUNET_SYSERR);
357       return;
358     }
359   ism = (const struct IndexStartMessage*) message;
360   fn = GNUNET_STRINGS_filename_expand ((const char*) &ism[1]);
361   if (fn == NULL)
362     {
363       GNUNET_SERVER_receive_done (client,
364                                   GNUNET_SYSERR);
365       return;
366     }
367   dev = ntohl (ism->device);
368   ino = GNUNET_ntohll (ism->inode);
369   ism = (const struct IndexStartMessage*) message;
370   slen = strlen (fn) + 1;
371   ii = GNUNET_malloc (sizeof (struct IndexInfo) + slen);
372   ii->filename = (const char*) &ii[1];
373   memcpy (&ii[1], fn, slen);
374   ii->file_id = ism->file_id;  
375 #if DEBUG_FS
376   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
377               "Received `%s' message for file `%s'\n",
378               "START_INDEX",
379               ii->filename);
380 #endif
381
382   ii->tc = GNUNET_SERVER_transmit_context_create (client);
383   mydev = 0;
384   myino = 0;
385   if ( ( (dev != 0) ||
386          (ino != 0) ) &&
387        (GNUNET_OK == GNUNET_DISK_file_get_identifiers (fn,
388                                                        &mydev,
389                                                        &myino)) &&
390        ( (dev == mydev) &&
391          (ino == myino) ) )
392     {      
393       /* fast validation OK! */
394       signal_index_ok (ii);
395       GNUNET_free (fn);
396       return;
397     }
398 #if DEBUG_FS
399   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
400               "Mismatch in file identifiers (%llu != %llu or %u != %u), need to hash.\n",
401               (unsigned long long) ino,
402               (unsigned long long) myino,
403               (unsigned int) dev,
404               (unsigned int) mydev);
405 #endif
406   /* slow validation, need to hash full file (again) */
407   ii->fhc = GNUNET_CRYPTO_hash_file (sched,
408                                      GNUNET_SCHEDULER_PRIORITY_IDLE,
409                                      fn,
410                                      HASHING_BLOCKSIZE,
411                                      &hash_for_index_val,
412                                      ii);
413   if (ii->fhc == NULL)    
414     hash_for_index_val (ii, NULL);    
415   GNUNET_free (fn);
416 }
417
418
419 /**
420  * Handle INDEX_LIST_GET-message.
421  *
422  * @param cls closure
423  * @param client identification of the client
424  * @param message the actual message
425  */
426 void
427 GNUNET_FS_handle_index_list_get (void *cls,
428                                  struct GNUNET_SERVER_Client *client,
429                                  const struct GNUNET_MessageHeader *message)
430 {
431   struct GNUNET_SERVER_TransmitContext *tc;
432   struct IndexInfoMessage *iim;
433   char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE];
434   size_t slen;
435   const char *fn;
436   struct IndexInfo *pos;
437
438   tc = GNUNET_SERVER_transmit_context_create (client);
439   iim = (struct IndexInfoMessage*) buf;
440   pos = indexed_files;
441   while (NULL != pos)
442     {
443       fn = pos->filename;
444       slen = strlen (fn) + 1;
445       if (slen + sizeof (struct IndexInfoMessage) > 
446           GNUNET_SERVER_MAX_MESSAGE_SIZE)
447         {
448           GNUNET_break (0);
449           break;
450         }
451       iim->header.type = htons (GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_ENTRY);
452       iim->header.size = htons (slen + sizeof (struct IndexInfoMessage));
453       iim->reserved = 0;
454       iim->file_id = pos->file_id;
455       memcpy (&iim[1], fn, slen);
456       GNUNET_SERVER_transmit_context_append_message (tc,
457                                                      &iim->header);
458       pos = pos->next;
459     }
460   GNUNET_SERVER_transmit_context_append_data (tc,
461                                               NULL, 0,
462                                               GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_END);
463   GNUNET_SERVER_transmit_context_run (tc,
464                                       GNUNET_TIME_UNIT_MINUTES);
465 }
466
467
468 /**
469  * Handle UNINDEX-message.
470  *
471  * @param cls closure
472  * @param client identification of the client
473  * @param message the actual message
474  */
475 void
476 GNUNET_FS_handle_unindex (void *cls,
477                           struct GNUNET_SERVER_Client *client,
478                           const struct GNUNET_MessageHeader *message)
479 {
480   const struct UnindexMessage *um;
481   struct IndexInfo *pos;
482   struct IndexInfo *prev;
483   struct IndexInfo *next;
484   struct GNUNET_SERVER_TransmitContext *tc;
485   int found;
486
487   um = (const struct UnindexMessage*) message;
488   found = GNUNET_NO;
489   prev = NULL;
490   pos = indexed_files;
491   while (NULL != pos)
492     {
493       next = pos->next;
494       if (0 == memcmp (&pos->file_id,
495                        &um->file_id,
496                        sizeof (GNUNET_HashCode)))
497         {
498           if (prev == NULL)
499             indexed_files = next;
500           else
501             prev->next = next;
502           GNUNET_break (GNUNET_OK ==
503                         GNUNET_CONTAINER_multihashmap_remove (ifm,
504                                                               &pos->file_id,
505                                                               (void*) pos->filename));
506           GNUNET_free (pos);
507           found = GNUNET_YES;
508         }
509       else
510         {
511           prev = pos;
512         }
513       pos = next;
514     }
515 #if DEBUG_FS
516   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
517               "Client requested unindexing of file `%s': %s\n",
518               GNUNET_h2s (&um->file_id),
519               found ? "found" : "not found");
520 #endif
521   if (GNUNET_YES == found)    
522     write_index_list ();
523   tc = GNUNET_SERVER_transmit_context_create (client);
524   GNUNET_SERVER_transmit_context_append_data (tc,
525                                               NULL, 0,
526                                               GNUNET_MESSAGE_TYPE_FS_UNINDEX_OK);
527   GNUNET_SERVER_transmit_context_run (tc,
528                                       GNUNET_TIME_UNIT_MINUTES);
529 }
530
531
532
533
534 /**
535  * Continuation called from datastore's remove
536  * function.
537  *
538  * @param cls unused
539  * @param success did the deletion work?
540  * @param msg error message
541  */
542 static void
543 remove_cont (void *cls,
544              int success,
545              const char *msg)
546 {
547   if (GNUNET_OK != success)
548     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
549                 _("Failed to delete bogus block: %s\n"),
550                 msg);
551 }
552
553
554 /**
555  * We've received an on-demand encoded block from the datastore.
556  * Attempt to do on-demand encoding and (if successful), call the
557  * continuation with the resulting block.  On error, clean up and ask
558  * the datastore for more results.
559  *
560  * @param key key for the content
561  * @param size number of bytes in data
562  * @param data content stored
563  * @param type type of the content
564  * @param priority priority of the content
565  * @param anonymity anonymity-level for the content
566  * @param expiration expiration time for the content
567  * @param uid unique identifier for the datum;
568  *        maybe 0 if no unique identifier is available
569  * @param cont function to call with the actual block (at most once, on success)
570  * @param cont_cls closure for cont
571  * @return GNUNET_OK on success
572  */
573 int
574 GNUNET_FS_handle_on_demand_block (const GNUNET_HashCode * key,
575                                   uint32_t size,
576                                   const void *data,
577                                   enum GNUNET_BLOCK_Type type,
578                                   uint32_t priority,
579                                   uint32_t anonymity,
580                                   struct GNUNET_TIME_Absolute
581                                   expiration, uint64_t uid,
582                                   GNUNET_DATASTORE_Iterator cont,
583                                   void *cont_cls)
584 {
585   const struct OnDemandBlock *odb;
586   GNUNET_HashCode nkey;
587   struct GNUNET_CRYPTO_AesSessionKey skey;
588   struct GNUNET_CRYPTO_AesInitializationVector iv;
589   GNUNET_HashCode query;
590   ssize_t nsize;
591   char ndata[DBLOCK_SIZE];
592   char edata[DBLOCK_SIZE];
593   const char *fn;
594   struct GNUNET_DISK_FileHandle *fh;
595   uint64_t off;
596
597   if (size != sizeof (struct OnDemandBlock))
598     {
599       GNUNET_break (0);
600       GNUNET_DATASTORE_remove (dsh,
601                                key,
602                                size,
603                                data,
604                                -1, -1,
605                                GNUNET_TIME_UNIT_FOREVER_REL,
606                                &remove_cont,
607                                NULL);
608       return GNUNET_SYSERR;
609     }
610   odb = (const struct OnDemandBlock*) data;
611   off = GNUNET_ntohll (odb->offset);
612   fn = (const char*) GNUNET_CONTAINER_multihashmap_get (ifm,
613                                                         &odb->file_id);
614   fh = NULL;
615   if ( (NULL == fn) ||
616        (NULL == (fh = GNUNET_DISK_file_open (fn, 
617                                              GNUNET_DISK_OPEN_READ,
618                                              GNUNET_DISK_PERM_NONE))) ||
619        (off !=
620         GNUNET_DISK_file_seek (fh,
621                                off,
622                                GNUNET_DISK_SEEK_SET)) ||
623        (-1 ==
624         (nsize = GNUNET_DISK_file_read (fh,
625                                         ndata,
626                                         sizeof (ndata)))) )
627     {
628       GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
629                   _("Could not access indexed file `%s' (%s) at offset %llu: %s\n"),
630                   GNUNET_h2s (&odb->file_id),
631                   fn,
632                   (unsigned long long) off,
633                   (fn == NULL) ? _("not indexed") : STRERROR (errno));
634       if (fh != NULL)
635         GNUNET_DISK_file_close (fh);
636       GNUNET_DATASTORE_remove (dsh,
637                                key,
638                                size,
639                                data,
640                                -1, -1,
641                                GNUNET_TIME_UNIT_FOREVER_REL,
642                                &remove_cont,
643                                NULL);
644       return GNUNET_SYSERR;
645     }
646   GNUNET_DISK_file_close (fh);
647   GNUNET_CRYPTO_hash (ndata,
648                       nsize,
649                       &nkey);
650   GNUNET_CRYPTO_hash_to_aes_key (&nkey, &skey, &iv);
651   GNUNET_CRYPTO_aes_encrypt (ndata,
652                              nsize,
653                              &skey,
654                              &iv,
655                              edata);
656   GNUNET_CRYPTO_hash (edata,
657                       nsize,
658                       &query);
659   if (0 != memcmp (&query, 
660                    key,
661                    sizeof (GNUNET_HashCode)))
662     {
663       GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
664                   _("Indexed file `%s' changed at offset %llu\n"),
665                   fn,
666                   (unsigned long long) off);
667       GNUNET_DATASTORE_remove (dsh,
668                                key,
669                                size,
670                                data,
671                                -1, -1,
672                                GNUNET_TIME_UNIT_FOREVER_REL,
673                                &remove_cont,
674                                NULL);
675       return GNUNET_SYSERR;
676     }
677 #if DEBUG_FS
678       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
679                   "On-demand encoded block for query `%s'\n",
680                   GNUNET_h2s (key));
681 #endif  
682   cont (cont_cls,
683         key,
684         nsize,
685         edata,
686         GNUNET_BLOCK_TYPE_DBLOCK,
687         priority,
688         anonymity,
689         expiration,
690         uid);
691   return GNUNET_OK;
692 }
693
694
695 /**
696  * Task run during shutdown.
697  *
698  * @param cls unused
699  * @param tc unused
700  */
701 static void
702 shutdown_task (void *cls,
703                const struct GNUNET_SCHEDULER_TaskContext *tc)
704 {
705   struct IndexInfo *pos;  
706
707   GNUNET_CONTAINER_multihashmap_destroy (ifm);
708   ifm = NULL;
709   while (NULL != (pos = indexed_files))
710     {
711       indexed_files = pos->next;
712       GNUNET_free (pos);
713     }
714   sched = NULL;
715   cfg = NULL;
716 }
717
718
719 /**
720  * Initialize the indexing submodule.
721  *
722  * @param s scheduler to use
723  * @param c configuration to use
724  * @param d datastore to use
725  */
726 int
727 GNUNET_FS_indexing_init (struct GNUNET_SCHEDULER_Handle *s,
728                          const struct GNUNET_CONFIGURATION_Handle *c,
729                          struct GNUNET_DATASTORE_Handle *d)
730 {
731   sched = s;
732   cfg = c;
733   dsh = d;
734   ifm = GNUNET_CONTAINER_multihashmap_create (128);
735   GNUNET_SCHEDULER_add_delayed (sched,
736                                 GNUNET_TIME_UNIT_FOREVER_REL,
737                                 &shutdown_task,
738                                 NULL);
739   read_index_list ();
740   return GNUNET_OK;
741 }
742
743 /* end of gnunet-service-fs_indexing.c */