]> code.citadel.org Git - citadel.git/commitdiff
*** empty log message ***
authorArt Cancro <ajc@citadel.org>
Wed, 18 May 2005 04:18:52 +0000 (04:18 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 18 May 2005 04:18:52 +0000 (04:18 +0000)
citadel/msgbase.c
citadel/serv_fulltext.c
citadel/serv_fulltext.h
citadel/serv_fulltext.o

index 7882460e110d3c4c54b0a4b953713cfcc7ed58d1..f9e2acab189f9df40a8b46e73699b206645a4f7d 100644 (file)
@@ -50,6 +50,7 @@
 #include "html.h"
 #include "genstamp.h"
 #include "internet_addressing.h"
+#include "serv_fulltext.h"
 
 extern struct config config;
 long config_msgnum;
@@ -3176,9 +3177,11 @@ void AdjRefCount(long msgnum, int incr)
 
        /* If the reference count is now zero, delete the message
         * (and its supplementary record as well).
+        * FIXME ... defer this so it doesn't keep the user waiting.
         */
        if (smi.meta_refcount == 0) {
                lprintf(CTDL_DEBUG, "Deleting message <%ld>\n", msgnum);
+               /* ft_index_message(msgnum, 0);  remove from fulltext index */
                delnum = msgnum;
                cdb_delete(CDB_MSGMAIN, &delnum, (int)sizeof(long));
                cdb_delete(CDB_BIGMSGS, &delnum, (int)sizeof(long));
index 4edff35dc10663afae41bee893e8d5055a638e5a..a07521ab24c40ef66aed920193be4d4d5baab124 100644 (file)
@@ -81,6 +81,10 @@ void ft_index_message(long msgnum, int op) {
        int num_msgs;
        long *msgs;
 
+       lprintf(CTDL_DEBUG, "ft_index_message() %s msg %ld\n",
+               (op ? "adding" : "removing") , msgnum
+       );
+
        msg = CtdlFetchMessage(msgnum, 1);
        if (msg == NULL) return;
 
@@ -94,8 +98,6 @@ void ft_index_message(long msgnum, int op) {
 
                        /* Add the message to the relevant token bucket */
 
-                       /* FIXME do "if op=1" ... */
-
                        /* FIXME lock the file */
                        cdb_bucket = cdb_fetch(CDB_FULLTEXT, &tokens[i], sizeof(int));
                        if (cdb_bucket == NULL) {
@@ -108,13 +110,16 @@ void ft_index_message(long msgnum, int op) {
                                num_msgs = cdb_bucket->len / sizeof(long);
                        }
 
-                       ++num_msgs;
-                       cdb_bucket->ptr = realloc(cdb_bucket->ptr, num_msgs*sizeof(long) );
-                       msgs = (long *) cdb_bucket->ptr;
-                       msgs[num_msgs - 1] = msgnum;
+                       if (op == 1) {  /* add to index */
+                               ++num_msgs;
+                               cdb_bucket->ptr = realloc(cdb_bucket->ptr, num_msgs*sizeof(long) );
+                               msgs = (long *) cdb_bucket->ptr;
+                               msgs[num_msgs - 1] = msgnum;
+                       }
 
-                       /* lprintf(CTDL_DEBUG, "bucket <%5d> position <%2d> msg <%ld>\n",
-                               tokens[i], num_msgs-1, msgnum); */
+                       if (op == 0) {  /* remove from index */
+                               /* FIXME do this */
+                       }
 
                        /* sort and purge dups */
                        if (num_msgs > 1) {
index 8d8bc3202e2c189deed4f62d41366f2859e785ab..6e3faeddba79b1b891f5cdcaa519aae0b71dc9d0 100644 (file)
@@ -3,3 +3,4 @@
  *
  */
 
+void ft_index_message(long msgnum, int op);
index 14c526891b28c40ebdd150861514c70beca83b9d..93f02f98cda1f1750b8d8f24bb6f743f08e31c4e 100644 (file)
Binary files a/citadel/serv_fulltext.o and b/citadel/serv_fulltext.o differ