[dovecot-cvs] dovecot/src/lib-storage/index index-mail.c, 1.74,
1.75 index-mail.h, 1.31, 1.32 index-status.c, 1.35,
1.36 index-storage.c, 1.70, 1.71 index-storage.h, 1.89, 1.90
cras at dovecot.org
cras at dovecot.org
Sun Apr 3 00:09:09 EEST 2005
- Previous message: [dovecot-cvs] dovecot/src/lib-storage mail-storage.h,1.93,1.94
- Next message: [dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-save.c, 1.76,
1.77 mbox-sync-parse.c, 1.36, 1.37 mbox-sync-private.h, 1.46,
1.47 mbox-sync-rewrite.c, 1.43, 1.44 mbox-sync-update.c, 1.29,
1.30 mbox-sync.c, 1.143, 1.144
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /var/lib/cvs/dovecot/src/lib-storage/index
In directory talvi:/tmp/cvs-serv14722/lib-storage/index
Modified Files:
index-mail.c index-mail.h index-status.c index-storage.c
index-storage.h
Log Message:
Keywords are now stored in X-Keywords headers in mbox. Did several related
API changes to get better performance.
Index: index-mail.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-mail.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -d -r1.74 -r1.75
--- index-mail.c 29 Mar 2005 16:48:45 -0000 1.74
+++ index-mail.c 2 Apr 2005 21:09:06 -0000 1.75
@@ -170,20 +170,41 @@
{
struct index_mail *mail = (struct index_mail *) _mail;
struct index_mail_data *data = &mail->data;
- const char *const *keywords;
+ array_t ARRAY_DEFINE(keyword_indexes_arr, unsigned int);
+ const char *const *names;
+ const unsigned int *keyword_indexes;
+ unsigned int i, count, names_count;
- if (data->keywords_buf == NULL) {
- data->keywords_buf =
- buffer_create_dynamic(mail->data_pool, 128);
- }
+ if (array_is_created(&data->keywords))
+ return array_get(&data->keywords, NULL);
+ t_push();
+ ARRAY_CREATE(&keyword_indexes_arr, pool_datastack_create(),
+ unsigned int, 128);
if (mail_index_lookup_keywords(mail->ibox->view, mail->data.seq,
- data->keywords_buf, &keywords) < 0) {
+ &keyword_indexes_arr) < 0) {
mail_storage_set_index_error(mail->ibox);
+ t_pop();
return NULL;
}
- return keywords;
+ keyword_indexes = array_get(&keyword_indexes_arr, &count);
+ names = array_get(mail->ibox->keyword_names, &names_count);
+
+ ARRAY_CREATE(&data->keywords, mail->data_pool, const char *, count);
+ for (i = 0; i < count; i++) {
+ const char *name;
+ i_assert(keyword_indexes[i] < names_count);
+
+ name = names[keyword_indexes[i]];
+ array_append(&data->keywords, &name, 1);
+ }
+
+ /* end with NULL */
+ (void)array_modifyable_append(&data->keywords);
+
+ t_pop();
+ return array_get(&data->keywords, NULL);
}
const struct message_part *index_mail_get_parts(struct mail *_mail)
Index: index-mail.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-mail.h,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- index-mail.h 29 Mar 2005 16:48:45 -0000 1.31
+++ index-mail.h 2 Apr 2005 21:09:07 -0000 1.32
@@ -53,7 +53,6 @@
struct index_mail_data {
enum mail_flags flags;
- const char *const *keywords;
time_t date, received_date;
uoff_t virtual_size, physical_size;
@@ -73,7 +72,7 @@
struct message_size hdr_size, body_size;
struct message_parser_ctx *parser_ctx;
int parsing_count;
- buffer_t *keywords_buf;
+ array_t ARRAY_DEFINE(keywords, const char *);
unsigned int parse_header:1;
unsigned int save_envelope:1;
Index: index-status.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-status.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- index-status.c 26 Dec 2004 09:12:42 -0000 1.35
+++ index-status.c 2 Apr 2005 21:09:07 -0000 1.36
@@ -29,10 +29,8 @@
}
}
- if (items & STATUS_KEYWORDS) {
+ if (items & STATUS_KEYWORDS)
status_r->keywords = mail_index_get_keywords(ibox->index);
- status_r->keywords_count = strarray_length(status_r->keywords);
- }
return 0;
}
Index: index-storage.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-storage.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- index-storage.c 15 Mar 2005 19:01:52 -0000 1.70
+++ index-storage.c 2 Apr 2005 21:09:07 -0000 1.71
@@ -332,6 +332,7 @@
ibox->cache = mail_index_get_cache(index);
index_cache_register_defaults(ibox);
ibox->view = mail_index_view_open(index);
+ ibox->keyword_names = mail_index_get_keywords(index);
return 0;
} while (0);
Index: index-storage.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-storage.h,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -d -r1.89 -r1.90
--- index-storage.h 15 Mar 2005 19:01:52 -0000 1.89
+++ index-storage.h 2 Apr 2005 21:09:07 -0000 1.90
@@ -62,6 +62,7 @@
uint32_t commit_log_file_seq;
uoff_t commit_log_file_offset;
+ const array_t *ARRAY_DEFINE_PTR(keyword_names, const char *);
struct mail_cache_field *cache_fields;
buffer_t *recent_flags;
uint32_t recent_flags_start_seq, recent_flags_count;
- Previous message: [dovecot-cvs] dovecot/src/lib-storage mail-storage.h,1.93,1.94
- Next message: [dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-save.c, 1.76,
1.77 mbox-sync-parse.c, 1.36, 1.37 mbox-sync-private.h, 1.46,
1.47 mbox-sync-rewrite.c, 1.43, 1.44 mbox-sync-update.c, 1.29,
1.30 mbox-sync.c, 1.143, 1.144
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the dovecot-cvs
mailing list