Timo Sirainen [Thu, 3 Sep 2015 18:37:09 +0000 (21:37 +0300)]
cassandra: Handle async queries internally - don't use sql pooling code.
There's no need to create multiple Cassandra instances, since the single
instance is capable of doing multiple asynchronous requests in parallel.
Timo Sirainen [Thu, 3 Sep 2015 17:55:18 +0000 (20:55 +0300)]
lib-storage: Another fix to using index_storage_mailbox_close() without an opened view.
Calling mail_index_close() without mail_index_open() caused it to
assert-crash.
Timo Sirainen [Thu, 3 Sep 2015 11:10:36 +0000 (14:10 +0300)]
Removed SET_IN_PORT_ZERO - SET_IN_PORT now always allows zeros as well.
A zero in all the port settings means that the port is disabled, which is
also the default. So it shouldn't be an error to explicitly set it to zero
in the config file.
Phil Carmody [Thu, 3 Sep 2015 11:01:57 +0000 (14:01 +0300)]
lib: strnum - simplify hex and oct overflow code
uintmax_t is defined to have modulo-2^n semantics, and therefore the bottom
bits of (uintmax_t) are guaranteed to be all set. Therefore the checking of
the next character read is unnecessary, as it's already done in the loop
control statement itself. (This is not true about the bottom digit base 10,
which is why the check remains in the decimal case)
Timo Sirainen [Wed, 2 Sep 2015 14:36:47 +0000 (17:36 +0300)]
dict: Use the new async APIs for everything.
If the dict backend supports async operations, this means that dict service
can now be configured with client_count>1.
Timo Sirainen [Wed, 2 Sep 2015 14:20:02 +0000 (17:20 +0300)]
lib-sql: Mark Cassandra driver as pooled.
Otherwise all the asynchronous operations will assert-crash, since all the
auto-connecting code is in the sqlpool code.
Timo Sirainen [Wed, 2 Sep 2015 14:19:08 +0000 (17:19 +0300)]
lib-sql: Debugging help - Added assert before clearing sql_result.callback.
If result is unrefed too many times, this still allows accessing the
callback from a debugger.
Timo Sirainen [Tue, 1 Sep 2015 13:25:11 +0000 (16:25 +0300)]
lib-imap-client: If connect() fails immediately, log an error and retry the next IP.
Only if all IPs fail return a full failure. This is mainly intended to skip
IPv6 addresses when IPv6 connectivity doesn't work.
Timo Sirainen [Mon, 31 Aug 2015 21:11:37 +0000 (00:11 +0300)]
auth: Added ":protected" suffix to passdb and userdb field names.
This means that if the field is set only if it hasn't already been set.
Usually an earlier passdb/userdb would have set the field and this is
setting a default (e.g. per-user settings override per-domain settings).
Teemu Huovila [Mon, 31 Aug 2015 10:33:26 +0000 (13:33 +0300)]
lib-fts: Add prefixing contraction filter.
Filters away prefixing contracted words, e.g. "l'homme" -> "homme".
Tokens to be filtered must be lower case. Only supports French in
this initial version.
Stephan Bosch [Sat, 29 Aug 2015 11:26:30 +0000 (14:26 +0300)]
Changed type of internet port values to in_port_t everywhere.
Created special SET_IN_PORT setting type for internet port values.
Created net_str2port() for parsing internet port values.
Removed several atoi() invocations in the process.
Stephan Bosch [Sat, 29 Aug 2015 11:20:57 +0000 (14:20 +0300)]
lib-http: client: Added proper handling of 408 response status.
This is treated as a special server connection close event, rather than a
response to the last issued request.
Timo Sirainen [Fri, 28 Aug 2015 13:07:35 +0000 (15:07 +0200)]
lib: If var_expand_with_funcs() function returns NULL, it should be treated the same as ""
The previous behavior was to return "%{foo:bar}" as "foo:bar}".
Timo Sirainen [Thu, 27 Aug 2015 15:34:52 +0000 (17:34 +0200)]
lib: Try fixing ec6e672a6e32 (ioloop timeout fixing)
Previous code was broken at least when moving a timeout between ioloops.
This is now tested and works.
Timo Sirainen [Thu, 27 Aug 2015 11:38:44 +0000 (13:38 +0200)]
dsync: Added -D parameter to disable mailbox renaming.
The renaming logic is annoyingly complex and there are some bugs left in it.
With this parameter renames are never even attempted, but instead a rename
would be done (slowly) with mailbox delete + create + fill.
Although with imapc protocol mailbox renames are rarely detected anyway.
Timo Sirainen [Thu, 27 Aug 2015 10:33:47 +0000 (12:33 +0200)]
dsync: Fixed again waiting for remote process wait to die.
We can't rely on stderr getting closed. It doesn't happen if the remote
process crashes. Now waiting for SIGCHLD in ioloop should solve this and
still log all the error messages at exit.
Stephan Bosch [Thu, 27 Aug 2015 08:39:26 +0000 (10:39 +0200)]
ioloop: Delay actual start of a new normal timeout until the next io_loop_run() cycle.
This makes sure that timeouts will not expire before they get a chance to
run.
Timo Sirainen [Wed, 26 Aug 2015 13:44:45 +0000 (15:44 +0200)]
dsync: Make sure we print all the stderr output from remote processes at deinit.
Earlier the final messages may have been lost, especially if debug logging
was enabled.
Timo Sirainen [Wed, 26 Aug 2015 13:05:06 +0000 (15:05 +0200)]
dsync: If mailbox export deinit failed, the failure state may not have reached mailbox importer.
The "end of list" was sent to the importer side dsync before export noticed
the failure. This could have caused import to complain about missing mails.
Timo Sirainen [Tue, 25 Aug 2015 15:27:44 +0000 (18:27 +0300)]
imap: Fixed hibernation to work with non-TCP connections.
Mainly meaning UNIX socket connections from login processes, which are
proxying TLS connections.
Timo Sirainen [Tue, 25 Aug 2015 13:50:17 +0000 (16:50 +0300)]
imapc: If FETCH commands fail, have imapc_mail_fetch() always return failure.
Earlier it may have returned success and imapc would later complain about a
missing FETCH field.
Timo Sirainen [Mon, 24 Aug 2015 15:06:42 +0000 (18:06 +0300)]
lib-master: struct master_service_connection.name must never be NULL, use "" instead.
Fixes crash at least in auth process when there are inet_listeners without
names.
Timo Sirainen [Mon, 24 Aug 2015 11:13:02 +0000 (14:13 +0300)]
Added imap-hibernate process for gathering IDLEing imap processes.
imap_hibernate_timeout setting controls how quickly the connection is moved
from imap process to imap-hibernate process.
Some IMAP extensions like NOTIFY, SEARCH=CONTEXT and COMPRESS aren't
supported yet.
There's also a new X-STATE command, which can be used to export the current
IMAP connection state to a string and later on imported to get back to the
original state (a quick resync feature for IMAP clients). However, this
command is disabled for now due to the current code being unoptimized for
untrusted input.