dovecot-2.0: fts: Fixed crashing with Squat.
dovecot at dovecot.org
dovecot at dovecot.org
Fri Aug 7 22:12:17 EEST 2009
details: http://hg.dovecot.org/dovecot-2.0/rev/c16ee25ec37b
changeset: 9744:c16ee25ec37b
user: Timo Sirainen <tss at iki.fi>
date: Fri Aug 07 15:12:04 2009 -0400
description:
fts: Fixed crashing with Squat.
A better solution would be for Squat to use existing mailboxes' Squat
indexes, but for now this isn't done.
diffstat:
3 files changed, 6 insertions(+), 3 deletions(-)
src/plugins/fts-solr/fts-backend-solr.c | 2 +-
src/plugins/fts/fts-api-private.h | 4 +++-
src/plugins/fts/fts-storage.c | 3 ++-
diffs (39 lines):
diff -r 2d2911c23232 -r c16ee25ec37b src/plugins/fts-solr/fts-backend-solr.c
--- a/src/plugins/fts-solr/fts-backend-solr.c Fri Aug 07 14:57:48 2009 -0400
+++ b/src/plugins/fts-solr/fts-backend-solr.c Fri Aug 07 15:12:04 2009 -0400
@@ -798,7 +798,7 @@ static int fts_backend_solr_lookup(struc
struct fts_backend fts_backend_solr = {
MEMBER(name) "solr",
- MEMBER(flags) 0,
+ MEMBER(flags) FTS_BACKEND_FLAG_VIRTUAL_LOOKUPS,
{
fts_backend_solr_init,
diff -r 2d2911c23232 -r c16ee25ec37b src/plugins/fts/fts-api-private.h
--- a/src/plugins/fts/fts-api-private.h Fri Aug 07 14:57:48 2009 -0400
+++ b/src/plugins/fts/fts-api-private.h Fri Aug 07 15:12:04 2009 -0400
@@ -43,7 +43,9 @@ enum fts_backend_flags {
/* If set, the backend is used for TEXT and BODY search
optimizations. Otherwise only TEXT_FAST and BODY_FAST are
optimized. */
- FTS_BACKEND_FLAG_SUBSTRING_LOOKUPS = 0x01
+ FTS_BACKEND_FLAG_SUBSTRING_LOOKUPS = 0x01,
+ /* Backend supports virtual mailbox lookups. */
+ FTS_BACKEND_FLAG_VIRTUAL_LOOKUPS = 0x02
};
struct fts_backend {
diff -r 2d2911c23232 -r c16ee25ec37b src/plugins/fts/fts-storage.c
--- a/src/plugins/fts/fts-storage.c Fri Aug 07 14:57:48 2009 -0400
+++ b/src/plugins/fts/fts-storage.c Fri Aug 07 15:12:04 2009 -0400
@@ -435,7 +435,8 @@ static int fts_build_init(struct fts_sea
return 0;
}
- if (fctx->fbox->virtual)
+ if (fctx->fbox->virtual &&
+ (fctx->build_backend->flags & FTS_BACKEND_FLAG_VIRTUAL_LOOKUPS) != 0)
ret = fts_build_init_virtual(fctx);
else
ret = fts_build_init_trans(fctx, fctx->t);
More information about the dovecot-cvs
mailing list