]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
10 years agovirtual: Added more asserts when DEBUG is enabled.
Timo Sirainen [Wed, 17 Jun 2015 11:24:06 +0000 (14:24 +0300)] 
virtual: Added more asserts when DEBUG is enabled.

10 years agovirtual: Added more asserts.
Timo Sirainen [Wed, 17 Jun 2015 11:23:38 +0000 (14:23 +0300)] 
virtual: Added more asserts.

10 years agofts-solr: Avoid sending too large queries to Solr due to listing wanted mailboxes.
Timo Sirainen [Wed, 17 Jun 2015 11:04:42 +0000 (14:04 +0300)] 
fts-solr: Avoid sending too large queries to Solr due to listing wanted mailboxes.
This is mainly a problem if there are a lot of mailboxes and "All Mails"
virtual mailbox. For now hardcoded to send max 10 mailboxes in the query,
afterwards it just returns matches in all the mailboxes and we'll filter out
the unwanted mailboxes.

10 years agofts-solr: Removed assert to fix indexing multiple mailboxes.
Timo Sirainen [Wed, 17 Jun 2015 10:55:37 +0000 (13:55 +0300)] 
fts-solr: Removed assert to fix indexing multiple mailboxes.
fts plugin may want to do last-uid lookup for a new mailbox while we still
have posting open for the previous one.

10 years agofts-tika: Fixed crashes when indexing larger attachments with fts-solr.
Timo Sirainen [Wed, 17 Jun 2015 10:12:37 +0000 (13:12 +0300)] 
fts-tika: Fixed crashes when indexing larger attachments with fts-solr.
We were mixing ioloops without switching back to the original ioloop in the
middle. Also io_remove() at deinit caused another timeout to be added, so
this needs to be done while original ioloop is active or we'll just leak the
just-added timeout in io_loop_destroy() and crash later.

10 years agolib-fs: Removed redundant o_stream_nfinish() calls
Timo Sirainen [Wed, 17 Jun 2015 09:22:17 +0000 (12:22 +0300)] 
lib-fs: Removed redundant o_stream_nfinish() calls

10 years agolib-fs: Call o_stream_nfinish() automatically for all backends in fs_write_stream_fin...
Timo Sirainen [Wed, 17 Jun 2015 09:21:52 +0000 (12:21 +0300)] 
lib-fs: Call o_stream_nfinish() automatically for all backends in fs_write_stream_finish()
Otherwise each backend needs to do it internally. fs-metawrap for example
was missing this and causing assert-crashes.

10 years agolib: test-data-stack - simplify #if-ing out of DEBUG-only fatal test
Phil Carmody [Wed, 17 Jun 2015 08:42:53 +0000 (11:42 +0300)] 
lib: test-data-stack - simplify #if-ing out of DEBUG-only fatal test
With no canaries, nothing can be tested, so just reduce this to a trivial
1-line return on the non-DEBUG case.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib: test-data-stack - ensure t_push() and t_pop() are balanced in fatal tests
Phil Carmody [Wed, 17 Jun 2015 08:42:30 +0000 (11:42 +0300)] 
lib: test-data-stack - ensure t_push() and t_pop() are balanced in fatal tests
If the t_pop() unexpectedly succeeds, we won't want to do another one upon
entering the function again.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agoauth: Added allow_real_nets setting.
Timo Sirainen [Wed, 17 Jun 2015 08:31:02 +0000 (11:31 +0300)] 
auth: Added allow_real_nets setting.
The difference to allow_nets is that it matches against the connection's
"real IP" rather than what the connection told was the original client's IP
address (%{rip} vs %{real_rip})

10 years agolib: Added unix_client_connect_msecs setting to connection API.
Timo Sirainen [Tue, 16 Jun 2015 14:19:12 +0000 (17:19 +0300)] 
lib: Added unix_client_connect_msecs setting to connection API.

10 years agolib: Compiler warning fix for test-ostream-failure-at.
Timo Sirainen [Tue, 16 Jun 2015 13:56:08 +0000 (16:56 +0300)] 
lib: Compiler warning fix for test-ostream-failure-at.

10 years agolib-fs: Added "randomfail" driver.
Timo Sirainen [Tue, 16 Jun 2015 13:40:29 +0000 (16:40 +0300)] 
lib-fs: Added "randomfail" driver.
Using this in front of fs drivers allows randomly injecting failures. For
example:

mail_attachment_fs = randomfail:all=10,read=30,read-range=2000-3000:sis posix

This means that all FS operations have a 10% chance of failing, except reads
have a 30% chance of failing. If the read fails, it'll fail somewhere
between offsets 2000-3000 (the default is 0, so it'll fail at the start of
file).

The supported operations are: wait metadata prefetch read write lock exists
stat copy rename delete iter. "all" applies to all of them.

The supported ranges are: read-range, write-range, iter-range.

10 years agolib: Added o_stream_create_failure_at() to inject EIO at given offset in ostream
Timo Sirainen [Tue, 16 Jun 2015 13:22:18 +0000 (16:22 +0300)] 
lib: Added o_stream_create_failure_at() to inject EIO at given offset in ostream

10 years agolib: Added i_stream_create_failure_at() to inject EIO at given offset in istream.
Timo Sirainen [Tue, 16 Jun 2015 13:21:56 +0000 (16:21 +0300)] 
lib: Added i_stream_create_failure_at() to inject EIO at given offset in istream.

10 years agodsync: If we stop because of a signal, log a warning about it.
Timo Sirainen [Tue, 16 Jun 2015 11:12:59 +0000 (14:12 +0300)] 
dsync: If we stop because of a signal, log a warning about it.

10 years agodoveadm: Added doveadm_killed_signo()
Timo Sirainen [Tue, 16 Jun 2015 11:12:33 +0000 (14:12 +0300)] 
doveadm: Added doveadm_killed_signo()

10 years agofts: Avoid expanding mail_search_args multiple times (for optimization & crash-avoidance)
Timo Sirainen [Mon, 15 Jun 2015 21:29:07 +0000 (00:29 +0300)] 
fts: Avoid expanding mail_search_args multiple times (for optimization & crash-avoidance)
Primarily this fixes the crash:

index-search-result.c: line 132 (index_search_result_update_flags):
assertion failed: (result->search_args->args == &search_arg)

It could be triggered by:
a search return (update) body body seen
b store 1 +flags \seen
c store 1 -flags \seen

10 years agofs-posix: fs_copy() didn't work with prefix= parameter
Timo Sirainen [Mon, 15 Jun 2015 21:16:42 +0000 (00:16 +0300)] 
fs-posix: fs_copy() didn't work with prefix= parameter

10 years agolib-stats: fix tristate-int vs. bool return value confusion
Phil Carmody [Mon, 15 Jun 2015 11:55:03 +0000 (14:55 +0300)] 
lib-stats: fix tristate-int vs. bool return value confusion
-1 was being silently converted to true. However, this was an error condition.

The callers don't need anything more complex than a bool, so kill the int.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib-fts: use NULL rather than 0 to shut up sparse
Phil Carmody [Mon, 15 Jun 2015 11:55:01 +0000 (14:55 +0300)] 
lib-fts: use NULL rather than 0 to shut up sparse
Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agodirector: explicitly mark _disconnect() helper static to match proto
Phil Carmody [Mon, 15 Jun 2015 11:54:58 +0000 (14:54 +0300)] 
director: explicitly mark _disconnect() helper static to match proto
No functional change, compiler would not have exported the symbol, this
just shuts up sparse.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agofs-metawrap: If written file unexpectedly shrinks, return error instead of assert...
Timo Sirainen [Mon, 15 Jun 2015 11:51:46 +0000 (14:51 +0300)] 
fs-metawrap: If written file unexpectedly shrinks, return error instead of assert-crash.
This shouldn't be happening, but we can't fully control it so an error is
better.

10 years agofs-metawrap: Don't assert-crash when writing an empty file.
Timo Sirainen [Mon, 15 Jun 2015 11:49:46 +0000 (14:49 +0300)] 
fs-metawrap: Don't assert-crash when writing an empty file.

10 years agolib-fts: Fix comment in fts-filter.h
Teemu Huovila [Mon, 15 Jun 2015 11:35:25 +0000 (14:35 +0300)] 
lib-fts: Fix comment in fts-filter.h

10 years agolib: test-failures - tests get/set handlers and the various log levels
Phil Carmody [Mon, 15 Jun 2015 11:31:19 +0000 (14:31 +0300)] 
lib: test-failures - tests get/set handlers and the various log levels
Also indirectoy tests the new lib-test test_expect* family.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib-test: test_expect_error_string() to match a single known message
Phil Carmody [Mon, 15 Jun 2015 11:31:19 +0000 (14:31 +0300)] 
lib-test: test_expect_error_string() to match a single known message
This gives us very fine control over what is acceptable as an expected warning.
Alas you have to do it for each message individually.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib-test: let tests invoke i_warning/i_error behaviour
Phil Carmody [Mon, 15 Jun 2015 11:31:19 +0000 (14:31 +0300)] 
lib-test: let tests invoke i_warning/i_error behaviour
Error-handling paths should be testable too. Permit a test case to register
that a known number of warnings/errors are to be expected, and to verify
that those warnings did occur afterwards. Too many messages will fail the
test exactly as it did in the past, they're unexpected messages. However,
too few messages will also cause the test case to fail.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib-test: flush test-assert failure messages
Phil Carmody [Mon, 15 Jun 2015 11:31:19 +0000 (14:31 +0300)] 
lib-test: flush test-assert failure messages
Diagnostic output to stderr may overtake these stdout logs if the streams
are combined by the shell or on the console. fflush() might help realign
them.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib: array - permit array_swap with uninitialised arrays
Phil Carmody [Mon, 15 Jun 2015 11:25:07 +0000 (14:25 +0300)] 
lib: array - permit array_swap with uninitialised arrays
Before initialisation, all fields are blank, so the element_size field
is not the actual size, and the i_assert would fire.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib-index: Added mail_index_ext_register_resize_defaults()
Timo Sirainen [Sat, 13 Jun 2015 14:05:49 +0000 (17:05 +0300)] 
lib-index: Added mail_index_ext_register_resize_defaults()

10 years agocassandra: Commit failures returned an already freed error string.
Timo Sirainen [Sat, 13 Jun 2015 13:46:06 +0000 (16:46 +0300)] 
cassandra: Commit failures returned an already freed error string.

10 years agolib-fts: Removed unnecessary data stack frames from test-fts-filter.
Timo Sirainen [Sat, 13 Jun 2015 12:10:23 +0000 (15:10 +0300)] 
lib-fts: Removed unnecessary data stack frames from test-fts-filter.
They are already added by lib-test/test-common.c

10 years agoconfig: Added hook_config_parser_end for plugins.
Timo Sirainen [Sat, 13 Jun 2015 11:36:43 +0000 (14:36 +0300)] 
config: Added hook_config_parser_end for plugins.

10 years agodoveadm mailbox delete -r: Delete all mailboxes when empty mailbox name is given.
Timo Sirainen [Fri, 12 Jun 2015 12:14:52 +0000 (15:14 +0300)] 
doveadm mailbox delete -r: Delete all mailboxes when empty mailbox name is given.

10 years agolib-fts: Don't crash if fts_icu_*() are used after fts_icu_deinit()
Timo Sirainen [Fri, 12 Jun 2015 10:02:08 +0000 (13:02 +0300)] 
lib-fts: Don't crash if fts_icu_*() are used after fts_icu_deinit()

10 years agolib-index: Avoid writing tail offset update to transaction log if it's not necessary.
Timo Sirainen [Thu, 11 Jun 2015 16:21:16 +0000 (19:21 +0300)] 
lib-index: Avoid writing tail offset update to transaction log if it's not necessary.
This should avoid extra writes that do nothing but update the tail offset.
mdbox's map requires this behavior, so disable it for it. For others it
might cause the next sync to read more data unnecessarily, but it should be
worth the extra cost of write most of the times.

10 years agodoveadm fetch: Added "refcount" field.
Timo Sirainen [Thu, 11 Jun 2015 16:08:13 +0000 (19:08 +0300)] 
doveadm fetch: Added "refcount" field.

10 years agocassandra: Error handling cleanup.
Timo Sirainen [Thu, 11 Jun 2015 13:19:05 +0000 (16:19 +0300)] 
cassandra: Error handling cleanup.
Probably doesn't fix any actual bugs.

10 years agocassandra: Minor code cleanup to make sure we don't try to access freed transaction...
Timo Sirainen [Thu, 11 Jun 2015 12:28:46 +0000 (15:28 +0300)] 
cassandra: Minor code cleanup to make sure we don't try to access freed transaction memory.

10 years agocassandra: Don't access freed memory when doing an assert-check.
Timo Sirainen [Thu, 11 Jun 2015 12:28:05 +0000 (15:28 +0300)] 
cassandra: Don't access freed memory when doing an assert-check.

10 years agodoveadm fs delete -R: More fixes to handling errors without crashing.
Timo Sirainen [Thu, 11 Jun 2015 12:19:53 +0000 (15:19 +0300)] 
doveadm fs delete -R: More fixes to handling errors without crashing.

10 years agolmtp: Fixed assert-crash on anvil lookup failures.
Timo Sirainen [Wed, 10 Jun 2015 17:29:35 +0000 (20:29 +0300)] 
lmtp: Fixed assert-crash on anvil lookup failures.
If anvil_client_query() fails, it immediately calls the callback and returns
NULL. So we need to increase anvil_queries even before calling
anvil_client_query()

10 years agodoveadm fs delete -R: Fixed hang when some of the deletions failed.
Timo Sirainen [Wed, 10 Jun 2015 16:50:29 +0000 (19:50 +0300)] 
doveadm fs delete -R: Fixed hang when some of the deletions failed.

10 years agocassandra: If log_level=debug/trace, log each query and its result.
Timo Sirainen [Wed, 10 Jun 2015 13:18:10 +0000 (16:18 +0300)] 
cassandra: If log_level=debug/trace, log each query and its result.

10 years agocassandra: Added extra asserts and sanity checks to make sure query errors are caught.
Timo Sirainen [Wed, 10 Jun 2015 13:09:13 +0000 (16:09 +0300)] 
cassandra: Added extra asserts and sanity checks to make sure query errors are caught.

10 years agocassandra: Don't crash on failed queries.
Timo Sirainen [Wed, 10 Jun 2015 13:08:28 +0000 (16:08 +0300)] 
cassandra: Don't crash on failed queries.

10 years agodict-sql: Don't try to optimize finding a matching map by using the previous match.
Timo Sirainen [Tue, 9 Jun 2015 16:32:09 +0000 (19:32 +0300)] 
dict-sql: Don't try to optimize finding a matching map by using the previous match.
In some setups multiple maps can match and it's important that the matching
is done in the same order always, otherwise the results could become
somewhat random.

10 years agoman: doveadm-pw.1: Fix typo.
Teemu Huovila [Fri, 5 Jun 2015 13:37:24 +0000 (16:37 +0300)] 
man: doveadm-pw.1: Fix typo.

10 years agoman: doveadm-pw.1: Added a note about quoting password hashes.
Pascal Volk [Thu, 4 Jun 2015 21:03:42 +0000 (21:03 +0000)] 
man: doveadm-pw.1: Added a note about quoting password hashes.

10 years agofts: lib-fts search arg expansion wasn't done for non-TEXT/BODY searches when fts_enf...
Timo Sirainen [Thu, 4 Jun 2015 18:57:32 +0000 (21:57 +0300)] 
fts: lib-fts search arg expansion wasn't done for non-TEXT/BODY searches when fts_enforced=no

10 years agofts: Added "doveadm fts expand" to show lib-fts search query expanded.
Timo Sirainen [Wed, 3 Jun 2015 21:45:11 +0000 (00:45 +0300)] 
fts: Added "doveadm fts expand" to show lib-fts search query expanded.

10 years agolib-storage: Added mail_search_args_to_cmdline()
Timo Sirainen [Wed, 3 Jun 2015 21:44:42 +0000 (00:44 +0300)] 
lib-storage: Added mail_search_args_to_cmdline()
This isn't entirely correct yet, but it's only going to be used for
debugging for now.

10 years agofts: Added "doveadm fts lookup" command.
Timo Sirainen [Wed, 3 Jun 2015 20:56:32 +0000 (23:56 +0300)] 
fts: Added "doveadm fts lookup" command.
This is mainly useful for debugging lib-fts. It doesn't perform any of the
lib-fts tokenization / filtering so you can do raw lookups.

10 years agolib-fts: fts_tokenizer_reset() didn't reset the entire state.
Timo Sirainen [Wed, 3 Jun 2015 19:39:52 +0000 (22:39 +0300)] 
lib-fts: fts_tokenizer_reset() didn't reset the entire state.

10 years agoindexer: Improved handling multiple indexing requests to the same mailbox.
Timo Sirainen [Wed, 3 Jun 2015 19:30:05 +0000 (22:30 +0300)] 
indexer: Improved handling multiple indexing requests to the same mailbox.
If a request arrives for a mailbox that we were already indexes, the
previous code simply sent the indexing request to the existing worker
process. This could have caused a lot of requests to be buffered to the same
mailbox if the indexing took a long time, which could have taken a while to
process even though they weren't really doing anything indexing work.

The new code instead just keeps track in memory that when the earlier
indexing is finished, it's done again once to finish any pending changes.

10 years agoindexer: Try to always flush as many requests from queue as possible.
Timo Sirainen [Wed, 3 Jun 2015 19:26:05 +0000 (22:26 +0300)] 
indexer: Try to always flush as many requests from queue as possible.
I don't think this changes the behavior much. It's mainly a code cleanup.

10 years agoindexer: Use array.h API instead of writing our own.
Timo Sirainen [Wed, 3 Jun 2015 19:25:28 +0000 (22:25 +0300)] 
indexer: Use array.h API instead of writing our own.
The space savings aren't worth the extra complexity.

10 years agofts: If mail indexing fails, don't log a "BUG: Unknown internal error"
Timo Sirainen [Wed, 3 Jun 2015 18:50:40 +0000 (21:50 +0300)] 
fts: If mail indexing fails, don't log a "BUG: Unknown internal error"

10 years agofts: If reading mail fails, log an error.
Timo Sirainen [Wed, 3 Jun 2015 18:49:52 +0000 (21:49 +0300)] 
fts: If reading mail fails, log an error.

10 years agolib-lda: Fixed crash in mail_deliver_get_log_var_expand_table().
Teemu Huovila [Wed, 3 Jun 2015 13:47:25 +0000 (16:47 +0300)] 
lib-lda: Fixed crash in mail_deliver_get_log_var_expand_table().
Discovered by clang static analyzer. This caused crashes with older versions
of Pigeonhole.

10 years agolib-fts: Added "english-possessive" filter.
Timo Sirainen [Tue, 2 Jun 2015 22:04:49 +0000 (01:04 +0300)] 
lib-fts: Added "english-possessive" filter.

10 years agolib-fts: Use UTF8_IS_START_SEQ()
Timo Sirainen [Tue, 2 Jun 2015 22:04:07 +0000 (01:04 +0300)] 
lib-fts: Use UTF8_IS_START_SEQ()

10 years agolib: Added UTF8_IS_START_SEQ() helper macro
Timo Sirainen [Tue, 2 Jun 2015 22:03:52 +0000 (01:03 +0300)] 
lib: Added UTF8_IS_START_SEQ() helper macro

10 years agolib-fts: fts-filter API changed to have a non-pointer vfuncs variable.
Timo Sirainen [Tue, 2 Jun 2015 21:46:23 +0000 (00:46 +0300)] 
lib-fts: fts-filter API changed to have a non-pointer vfuncs variable.
The main benefit being that the fts-filter implementations can save a few
lines of code.

10 years agolib-fts: fts-lowercase can now use the default destroy function.
Timo Sirainen [Tue, 2 Jun 2015 21:43:51 +0000 (00:43 +0300)] 
lib-fts: fts-lowercase can now use the default destroy function.

10 years agolib-fts: Implemented default create/destory functions for fts-filters.
Timo Sirainen [Tue, 2 Jun 2015 21:43:28 +0000 (00:43 +0300)] 
lib-fts: Implemented default create/destory functions for fts-filters.

10 years agolib-fts: Moved IS_APOSTROPHE() to fts-common.h
Timo Sirainen [Tue, 2 Jun 2015 21:39:11 +0000 (00:39 +0300)] 
lib-fts: Moved IS_APOSTROPHE() to fts-common.h

10 years agoexample-config: Updated deliver_log_format comments
Timo Sirainen [Tue, 2 Jun 2015 20:46:28 +0000 (23:46 +0300)] 
example-config: Updated deliver_log_format comments

10 years agolib-lda: Added %{to_envelope} to deliver_log_format
Timo Sirainen [Tue, 2 Jun 2015 20:43:05 +0000 (23:43 +0300)] 
lib-lda: Added %{to_envelope} to deliver_log_format

10 years agolib-fts: Compiling fix without libicu
Timo Sirainen [Tue, 2 Jun 2015 20:35:23 +0000 (23:35 +0300)] 
lib-fts: Compiling fix without libicu

10 years agolib-fts: Avoid compiler warning when building without libicu
Timo Sirainen [Tue, 2 Jun 2015 20:28:35 +0000 (23:28 +0300)] 
lib-fts: Avoid compiler warning when building without libicu

10 years agoimapc: If auth fails due to connection failure, don't treat it the same as failed...
Timo Sirainen [Tue, 2 Jun 2015 19:47:21 +0000 (22:47 +0300)] 
imapc: If auth fails due to connection failure, don't treat it the same as failed login.

10 years agolib-fts: Fixed compiling without libicu
Timo Sirainen [Tue, 2 Jun 2015 19:20:03 +0000 (22:20 +0300)] 
lib-fts: Fixed compiling without libicu

10 years agolib-fts: Added more supported languages.
Timo Sirainen [Tue, 2 Jun 2015 19:16:46 +0000 (22:16 +0300)] 
lib-fts: Added more supported languages.
This includes now all the ones that are currently supported by both snowball
and exttextcat.

10 years agolib-fts: Optimized truncation of partial trailing UTF-8 characters in tokenizers.
Timo Sirainen [Tue, 2 Jun 2015 19:01:07 +0000 (22:01 +0300)] 
lib-fts: Optimized truncation of partial trailing UTF-8 characters in tokenizers.

10 years agolib-fts: Use fts_icu_lcase() for fts-filter-lowercase if possible.
Timo Sirainen [Tue, 2 Jun 2015 18:56:29 +0000 (21:56 +0300)] 
lib-fts: Use fts_icu_lcase() for fts-filter-lowercase if possible.

10 years agolib-fts: Added string_t *token to struct fts_filter
Timo Sirainen [Tue, 2 Jun 2015 18:56:03 +0000 (21:56 +0300)] 
lib-fts: Added string_t *token to struct fts_filter
This makes the work a bit easier for simple filters that don't need any
state but want to use a string_t.

10 years agolib-fts: Added fts_icu_lcase()
Timo Sirainen [Tue, 2 Jun 2015 18:54:52 +0000 (21:54 +0300)] 
lib-fts: Added fts_icu_lcase()

10 years agolib-fts: Do all the ICU cleanup in fts_icu_deinit().
Timo Sirainen [Tue, 2 Jun 2015 18:49:46 +0000 (21:49 +0300)] 
lib-fts: Do all the ICU cleanup in fts_icu_deinit().

10 years agolib-fts: Include fts-filter.h in fts-filter-private.h
Timo Sirainen [Tue, 2 Jun 2015 18:45:46 +0000 (21:45 +0300)] 
lib-fts: Include fts-filter.h in fts-filter-private.h
This avoids having to always include them both.

10 years agolib-fts: Renamed variable.
Timo Sirainen [Tue, 2 Jun 2015 18:43:27 +0000 (21:43 +0300)] 
lib-fts: Renamed variable.
This is a lowercase-filter, not a normalizer.

10 years agolib-fts: Removed unnecessary array.h include from fts-filter.h
Timo Sirainen [Tue, 2 Jun 2015 18:41:46 +0000 (21:41 +0300)] 
lib-fts: Removed unnecessary array.h include from fts-filter.h

10 years agolib-fts: Fixed tr29 tokenizer to delete last character correctly when it's preceded...
Timo Sirainen [Tue, 2 Jun 2015 17:50:23 +0000 (20:50 +0300)] 
lib-fts: Fixed tr29 tokenizer to delete last character correctly when it's preceded by non-ASCII

10 years agopop3-login: Added support for Zimbra proxy's XOIP command.
Timo Sirainen [Tue, 2 Jun 2015 16:59:45 +0000 (19:59 +0300)] 
pop3-login: Added support for Zimbra proxy's XOIP command.

10 years agofts: If we fail while indexing headers, return failure immediately.
Timo Sirainen [Tue, 2 Jun 2015 16:52:37 +0000 (19:52 +0300)] 
fts: If we fail while indexing headers, return failure immediately.

10 years agofts: Error logging fix.
Timo Sirainen [Tue, 2 Jun 2015 16:52:15 +0000 (19:52 +0300)] 
fts: Error logging fix.
1) We were logging the error after it was already freed from data stack.
2) We were logging uninitialized error string when fts indexing was the one
that failed.

10 years agofts: Fixed memory leak at deinit when using multiple fts plugins at the same time...
Timo Sirainen [Mon, 1 Jun 2015 23:39:20 +0000 (02:39 +0300)] 
fts: Fixed memory leak at deinit when using multiple fts plugins at the same time using libfts.

10 years agolib-fts: Correct comment in filter internal API.
Teemu Huovila [Mon, 1 Jun 2015 23:26:44 +0000 (02:26 +0300)] 
lib-fts: Correct comment in filter internal API.

10 years agolib-fts: Call libicu u_cleanup.
Teemu Huovila [Mon, 1 Jun 2015 23:26:44 +0000 (02:26 +0300)] 
lib-fts: Call libicu u_cleanup.

10 years agovarious: use new uni_utf8_get_char*() interface
Phil Carmody [Mon, 1 Jun 2015 19:16:19 +0000 (22:16 +0300)] 
various: use new uni_utf8_get_char*() interface
No need for additional uni_utf8_char_bytes() calls if you can parse and
know the size with one call.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib-fts: Use new uni_utf8_get_char*() interface
Timo Sirainen [Mon, 1 Jun 2015 19:14:19 +0000 (22:14 +0300)] 
lib-fts: Use new uni_utf8_get_char*() interface

10 years agolib: Improved unit test for uni_utf8_get_char() return value check.
Timo Sirainen [Mon, 1 Jun 2015 19:11:55 +0000 (22:11 +0300)] 
lib: Improved unit test for uni_utf8_get_char() return value check.

10 years agolib: API change - have uni_utf8_get_char*() return _char_bytes
Phil Carmody [Mon, 1 Jun 2015 19:08:43 +0000 (22:08 +0300)] 
lib: API change - have uni_utf8_get_char*() return _char_bytes
Often the two functions are called in close proximity (both ways round). As
_get_char*() calls _char_bytes() early on the success path, we may as well
return that value to the caller for immediate use.

The callers which call _char_bytes() first are simply rejecting the truncated
case quickly - all other invalid cases still call both functions, and all
other valid cases (which should be the fast path) likewise call both.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agofts-solr: laxer check of uni_utf8_get_char_n() return value
Phil Carmody [Mon, 1 Jun 2015 19:08:27 +0000 (22:08 +0300)] 
fts-solr: laxer check of uni_utf8_get_char_n() return value
If uni_utf8_get_char*() were changed to return the number of bytes in the
character on success, then all we care about is it being > 0 (i.e. not
error, not truncated).

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib: test-unichar - test invalid utf8 encodings
Phil Carmody [Mon, 1 Jun 2015 19:07:44 +0000 (22:07 +0300)] 
lib: test-unichar - test invalid utf8 encodings
Chop trailing characters off valid encodings, and watch them fail.
(There's no need to do this on most of the test characters, as they're
truncated to the same byte sequence - only do 1 in 64.)

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib: test-unichar - streamline the unichars test
Phil Carmody [Mon, 1 Jun 2015 19:06:44 +0000 (22:06 +0300)] 
lib: test-unichar - streamline the unichars test
It's doing 2 kinds of tests, split them into separate test cases.

And the first part has started to get expensive, so just make sure
all code paths are tested by skipping most values. Only 3 from each
set of 64 (lowest 6 bits) are tested.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib-fts: Added unit testing for unicode apostrophe handling.
Timo Sirainen [Mon, 1 Jun 2015 18:59:02 +0000 (21:59 +0300)] 
lib-fts: Added unit testing for unicode apostrophe handling.

10 years agolib-fts: tokenizers - Fixed removal of trailing character in truncated tokens.
Timo Sirainen [Mon, 1 Jun 2015 18:58:30 +0000 (21:58 +0300)] 
lib-fts: tokenizers - Fixed removal of trailing character in truncated tokens.
If the token is truncated, we don't want to remove the trailing character
since it's not actually there.

Also we don't want to remove trailing apostrophes from a truncated word,
because they're not actually at the end of the (untruncated) token there.
This doesn't make a big difference, but it's slightly more correct.

10 years agolib-fts: Optimize tokenizers - Rewrite of apostrophe handling.
Timo Sirainen [Mon, 1 Jun 2015 18:51:33 +0000 (21:51 +0300)] 
lib-fts: Optimize tokenizers - Rewrite of apostrophe handling.
We parse through the UTF8 characters only once now, not twice.