]> code.citadel.org Git - citadel.git/blobdiff - citadel/serv_fulltext.c
Cleaned up some commented-out stuff that was left in various files
[citadel.git] / citadel / serv_fulltext.c
index 2c23d49dc09b30387fe1e7785d2f9a6dd0396778..cf28dce181a116c7f60d062f09eacdece70bde14 100644 (file)
@@ -175,8 +175,6 @@ void ft_index_message(long msgnum, int op) {
                        else {
                                lprintf(CTDL_ALERT, "Invalid token %d !!\n", tok);
                        }
-
-                       /* FIXME do we need to unlock the file here? */
                }
 
                free(tokens);
@@ -208,7 +206,7 @@ void ft_index_msg(long msgnum, void *userdata) {
 void ft_index_room(struct ctdlroom *qrbuf, void *data)
 {
        getroom(&CC->room, qrbuf->QRname);
-       CtdlForEachMessage(MSGS_ALL, 0L, NULL, NULL, ft_index_msg, NULL);
+       CtdlForEachMessage(MSGS_ALL, 0L, NULL, NULL, NULL, ft_index_msg, NULL);
 }
 
 
@@ -249,12 +247,16 @@ void do_fulltext_indexing(void) {
         * If we've switched wordbreaker modules, burn the index and start
         * over.
         */
+       begin_critical_section(S_CONTROL);
+       lprintf(CTDL_DEBUG, "wb ver on disk = %d, code ver = %d\n",
+                       CitControl.fulltext_wordbreaker, FT_WORDBREAKER_ID);
        if (CitControl.fulltext_wordbreaker != FT_WORDBREAKER_ID) {
                lprintf(CTDL_INFO, "(re)initializing full text index\n");
                cdb_trunc(CDB_FULLTEXT);
                CitControl.MMfulltext = 0L;
                put_control();
        }
+       end_critical_section(S_CONTROL);
 
        /*
         * Now go through each room and find messages to index.
@@ -309,9 +311,11 @@ void do_fulltext_indexing(void) {
 
        /* Save our place so we don't have to do this again */
        ft_flush_cache();
+       begin_critical_section(S_CONTROL);
        CitControl.MMfulltext = ft_newhighest;
        CitControl.fulltext_wordbreaker = FT_WORDBREAKER_ID;
        put_control();
+       end_critical_section(S_CONTROL);
        last_index = time(NULL);
 
        lprintf(CTDL_DEBUG, "do_fulltext_indexing() finished\n");