]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
7 years agodriver-sqlite: Assign db in driver_sqlite_exec()
Martti Rannanjärvi [Mon, 10 Sep 2018 09:19:29 +0000 (12:19 +0300)] 
driver-sqlite: Assign db in driver_sqlite_exec()

This fixes a crash.

7 years agostats: Wait for clients to disconnect at shutdown
Timo Sirainen [Fri, 7 Sep 2018 08:19:43 +0000 (11:19 +0300)] 
stats: Wait for clients to disconnect at shutdown

7 years agoglobal: Replace MASTER_SERVICE_FLAG_SEND_STATS with _DONT_SEND_STATS
Timo Sirainen [Thu, 6 Sep 2018 14:04:00 +0000 (17:04 +0300)] 
global: Replace MASTER_SERVICE_FLAG_SEND_STATS with _DONT_SEND_STATS

Most services want to send statistics, so it's better to reverse the flag
behavior. Mark the few services that don't want stats with
MASTER_SERVICE_FLAG_DONT_SEND_STATS.

7 years agomaster: Start service processes only after adding all service listeners
Timo Sirainen [Thu, 6 Sep 2018 16:48:09 +0000 (19:48 +0300)] 
master: Start service processes only after adding all service listeners

Otherwise the processes could try to connect to services that aren't being
listened on, causing errors. Especially stats-writer socket needs to be
available early on.

7 years agolib-storage: Don't try to deserialize bodystructure if we already have it
Josef 'Jeff' Sipek [Fri, 7 Sep 2018 14:43:43 +0000 (10:43 -0400)] 
lib-storage: Don't try to deserialize bodystructure if we already have it

Fixes:
Panic: file message-part-data.c: line 37 (message_part_data_is_plain_7bit): assertion failed: (data != NULL)

7 years agolib-storage: Simplify an assertion condition
Josef 'Jeff' Sipek [Thu, 6 Sep 2018 15:07:22 +0000 (11:07 -0400)] 
lib-storage: Simplify an assertion condition

Since the i_assert() is guarded by a check for save_bodystructure_header
being true, the whole condition can be simplified.

7 years agolib-storage: Don't try to process header if we haven't parsed the body structure
Josef 'Jeff' Sipek [Thu, 6 Sep 2018 15:06:17 +0000 (11:06 -0400)] 
lib-storage: Don't try to process header if we haven't parsed the body structure

Fixes:
Panic: file index-mail-headers.c: line 294 (index_mail_parse_header): assertion failed: (part != NULL)

7 years agolib-http: client: peer: Log the number of pending connections consistently in relevan...
Stephan Bosch [Thu, 6 Sep 2018 01:40:55 +0000 (03:40 +0200)] 
lib-http: client: peer: Log the number of pending connections consistently in relevant debug messages.

Use the same style everywhere and log it where it makes sense.

7 years agolib-http: client: peer: Maintain a list of connections pending on behalf of a peer.
Stephan Bosch [Thu, 6 Sep 2018 01:33:59 +0000 (03:33 +0200)] 
lib-http: client: peer: Maintain a list of connections pending on behalf of a peer.

Before, pending connections were only listed in the peer pool.

7 years agolib-http: client: connection: Unlist the connection as pending immediately in http_cl...
Stephan Bosch [Thu, 6 Sep 2018 01:23:26 +0000 (03:23 +0200)] 
lib-http: client: connection: Unlist the connection as pending immediately in http_client_connection_failure().

7 years agolib-http: client: connection: Remove the connection from the peer pool pending list...
Stephan Bosch [Wed, 5 Sep 2018 23:57:43 +0000 (01:57 +0200)] 
lib-http: client: connection: Remove the connection from the peer pool pending list in a separate function.

7 years agolib-http: client: peer: Notify all peers in a peer pool about a successful connection.
Stephan Bosch [Thu, 6 Sep 2018 13:22:30 +0000 (15:22 +0200)] 
lib-http: client: peer: Notify all peers in a peer pool about a successful connection.

This allows peers for which the last connection attempt failed (which was not
the last pending attempt in the pool) to try again. This solves a problem that
could potentially cause a hang with multiple parallel clients creating serveral
new connections at once.

7 years agolib-http: client: peer: Add debug message for http_client_peer_connection_failure().
Stephan Bosch [Thu, 6 Sep 2018 14:03:58 +0000 (16:03 +0200)] 
lib-http: client: peer: Add debug message for http_client_peer_connection_failure().

7 years agolib-http: client: peer: Clarify debug message in http_client_peer_connection_failed_p...
Stephan Bosch [Thu, 6 Sep 2018 13:56:44 +0000 (15:56 +0200)] 
lib-http: client: peer: Clarify debug message in http_client_peer_connection_failed_pool().

7 years agolib-http: client: peer: Log debug message before calling peer pool in http_client_pee...
Stephan Bosch [Thu, 6 Sep 2018 13:54:02 +0000 (15:54 +0200)] 
lib-http: client: peer: Log debug message before calling peer pool in http_client_peer_connection_success().

7 years agolib-http: client: peer: Rename http_client_peer_connection_failed_any() to http_clien...
Stephan Bosch [Thu, 6 Sep 2018 13:50:36 +0000 (15:50 +0200)] 
lib-http: client: peer: Rename http_client_peer_connection_failed_any() to http_client_peer_connection_failed_pool().

7 years agolib-http: client: peer: Always run http_client_queue_connection_failure() upon defini...
Stephan Bosch [Thu, 6 Sep 2018 01:11:18 +0000 (03:11 +0200)] 
lib-http: client: peer: Always run http_client_queue_connection_failure() upon definitive connection failure.

The recorded peer->connecting flag was highly unreliable in a scenario involving
starting parallel connections. This way, the linked queues can update their
state accordingly. Also, this will not cause empty queues to initiate new
connection, because empty queues will do nothing after updating the connection
state.

This problem caused a client ioloop hang in high-load conditions.

7 years agolib-http: client: peer: Move http_client_peer_connection_failure().
Stephan Bosch [Thu, 6 Sep 2018 12:57:28 +0000 (14:57 +0200)] 
lib-http: client: peer: Move http_client_peer_connection_failure().

7 years agolib-http: client: queue: Do not fail claimed requests unless the queue is being destr...
Stephan Bosch [Thu, 6 Sep 2018 01:02:16 +0000 (03:02 +0200)] 
lib-http: client: queue: Do not fail claimed requests unless the queue is being destroyed.

Before, connection failure would also abort requests already being sent on
another connection, which is premature at best.

7 years agolib-http: client: queue: Fix the number of pending requests listed in http_client_que...
Stephan Bosch [Thu, 6 Sep 2018 00:57:24 +0000 (02:57 +0200)] 
lib-http: client: queue: Fix the number of pending requests listed in http_client_queue_connection_failure() debug message.

7 years agolib-http: client: peer: Determine number of pending peers in http_client_peer_shared_...
Stephan Bosch [Thu, 6 Sep 2018 00:51:09 +0000 (02:51 +0200)] 
lib-http: client: peer: Determine number of pending peers in http_client_peer_shared_connection_failure() itself.

Before, the number of pending peers was a parameter, but that was only for a
single peer pool. This is wrong, since the one peer can have many different
pools (depending on how many clients with incompatible configs share this
peer).

7 years agolib-http: client: peer: Notify definitive connection failure only within a peer pool.
Stephan Bosch [Thu, 6 Sep 2018 12:49:59 +0000 (14:49 +0200)] 
lib-http: client: peer: Notify definitive connection failure only within a peer pool.

Other peer pools have different configuration, which may actually succeed and
will arrive at this point when their own connections fail anyway.

7 years agodriver-sqlite: Fix event usage in driver_sqlite_exec
Aki Tuomi [Thu, 6 Sep 2018 06:36:07 +0000 (09:36 +0300)] 
driver-sqlite: Fix event usage in driver_sqlite_exec

Broken in 850f874971a7afa4f1f7b47df37fca082dc415a1

7 years agopop3: Do not expunge \Deleted mails without QUIT
Aki Tuomi [Wed, 5 Sep 2018 16:34:20 +0000 (19:34 +0300)] 
pop3: Do not expunge \Deleted mails without QUIT

Prevents loss of email if connection
is unexpectedly terminated.

7 years agolib-sql: Do not create event for old drivers
Aki Tuomi [Wed, 5 Sep 2018 10:20:02 +0000 (13:20 +0300)] 
lib-sql: Do not create event for old drivers

They can't use it anyways

7 years agolib: Test event category parent matching
Martti Rannanjärvi [Wed, 5 Sep 2018 09:25:56 +0000 (12:25 +0300)] 
lib: Test event category parent matching

7 years agodriver-sqlpool: Only strdup error on error
Aki Tuomi [Wed, 5 Sep 2018 05:34:28 +0000 (08:34 +0300)] 
driver-sqlpool: Only strdup error on error

Satisfies static analyzers

7 years agodriver-sqlite: Document why rollback is called when commit fails
Aki Tuomi [Tue, 4 Sep 2018 17:30:12 +0000 (20:30 +0300)] 
driver-sqlite: Document why rollback is called when commit fails

7 years agodriver-cassandra: Add events
Aki Tuomi [Sun, 2 Sep 2018 16:14:17 +0000 (19:14 +0300)] 
driver-cassandra: Add events

7 years agodriver-pgsql: Add events
Aki Tuomi [Sat, 1 Sep 2018 10:50:27 +0000 (13:50 +0300)] 
driver-pgsql: Add events

7 years agodriver-sqlite: Add events
Aki Tuomi [Fri, 31 Aug 2018 10:30:11 +0000 (13:30 +0300)] 
driver-sqlite: Add events

7 years agodriver-mysql: Add events
Aki Tuomi [Fri, 31 Aug 2018 06:45:59 +0000 (09:45 +0300)] 
driver-mysql: Add events

7 years agodriver-sqlpool: Add events
Aki Tuomi [Fri, 31 Aug 2018 06:31:48 +0000 (09:31 +0300)] 
driver-sqlpool: Add events

7 years agolib-sql: Add events
Aki Tuomi [Thu, 30 Aug 2018 11:23:10 +0000 (14:23 +0300)] 
lib-sql: Add events

7 years agoauth: Use sql_init_full
Aki Tuomi [Mon, 3 Sep 2018 10:59:41 +0000 (13:59 +0300)] 
auth: Use sql_init_full

7 years agoglobal: Replace sql_db_cache_new with sql_db_cache_new2
Aki Tuomi [Tue, 4 Sep 2018 06:31:25 +0000 (09:31 +0300)] 
global: Replace sql_db_cache_new with sql_db_cache_new2

7 years agodict-sql: Use sql_db_cache_new2
Aki Tuomi [Mon, 3 Sep 2018 11:13:55 +0000 (14:13 +0300)] 
dict-sql: Use sql_db_cache_new2

7 years agolib-sql: Add sql_db_cache_new2 that uses the new sql_init_full initializer
Aki Tuomi [Mon, 3 Sep 2018 11:12:05 +0000 (14:12 +0300)] 
lib-sql: Add sql_db_cache_new2 that uses the new sql_init_full initializer

7 years agodriver-cassandra: Add init_full
Aki Tuomi [Sun, 2 Sep 2018 15:45:14 +0000 (18:45 +0300)] 
driver-cassandra: Add init_full

7 years agodriver-cassandra: Return error from connection string parser
Aki Tuomi [Sun, 2 Sep 2018 15:39:47 +0000 (18:39 +0300)] 
driver-cassandra: Return error from connection string parser

7 years agodriver-cassandra: Add driver_cassandra_free
Aki Tuomi [Tue, 4 Sep 2018 06:43:32 +0000 (09:43 +0300)] 
driver-cassandra: Add driver_cassandra_free

7 years agodriver-pgsql: Add init_full
Aki Tuomi [Sat, 1 Sep 2018 10:43:19 +0000 (13:43 +0300)] 
driver-pgsql: Add init_full

7 years agodriver-pgsql: Add driver_pgsql_free
Aki Tuomi [Tue, 4 Sep 2018 06:39:06 +0000 (09:39 +0300)] 
driver-pgsql: Add driver_pgsql_free

7 years agodriver-sqlite: Add init_full
Aki Tuomi [Fri, 31 Aug 2018 10:29:56 +0000 (13:29 +0300)] 
driver-sqlite: Add init_full

7 years agodriver-mysql: Add init_full
Aki Tuomi [Mon, 3 Sep 2018 09:17:40 +0000 (12:17 +0300)] 
driver-mysql: Add init_full

7 years agodriver-mysql: Allocate mysql connection ourselves
Aki Tuomi [Fri, 31 Aug 2018 11:07:44 +0000 (14:07 +0300)] 
driver-mysql: Allocate mysql connection ourselves

This allows reusing the same mysql object on reconnect,
and simplifies cleanup in case initialization fails.

7 years agodriver-mysql: Return error in connection string parser
Aki Tuomi [Mon, 3 Sep 2018 09:15:55 +0000 (12:15 +0300)] 
driver-mysql: Return error in connection string parser

7 years agodriver-sqlpool: Add driver_sqlpool_init_full
Aki Tuomi [Thu, 30 Aug 2018 11:17:13 +0000 (14:17 +0300)] 
driver-sqlpool: Add driver_sqlpool_init_full

Needed by SQL API change

7 years agodriver-sqlpool: Use init_full when available
Aki Tuomi [Fri, 31 Aug 2018 09:43:11 +0000 (12:43 +0300)] 
driver-sqlpool: Use init_full when available

7 years agolib-sql: Add init_full vfunction
Aki Tuomi [Thu, 30 Aug 2018 11:18:41 +0000 (14:18 +0300)] 
lib-sql: Add init_full vfunction

7 years agodriver-sqlite: Whitespace fix
Aki Tuomi [Fri, 31 Aug 2018 10:07:03 +0000 (13:07 +0300)] 
driver-sqlite: Whitespace fix

7 years agoauth: Add db_ prefix to sql in db-sql
Aki Tuomi [Fri, 31 Aug 2018 06:20:16 +0000 (09:20 +0300)] 
auth: Add db_ prefix to sql in db-sql

Prevents clash with lib-sql

7 years agolib-master: Fix crash when stats events are merged all the way to the root
Timo Sirainen [Mon, 3 Sep 2018 11:15:07 +0000 (14:15 +0300)] 
lib-master: Fix crash when stats events are merged all the way to the root

7 years agolib-master: stats_event_get_merged() - Remove unnecessary variable assignment
Timo Sirainen [Mon, 3 Sep 2018 10:14:39 +0000 (13:14 +0300)] 
lib-master: stats_event_get_merged() - Remove unnecessary variable assignment

Fixes scan-build complaint.

7 years agolib: Move log type to be written before appended log prefix
Timo Sirainen [Fri, 31 Aug 2018 12:06:09 +0000 (15:06 +0300)] 
lib: Move log type to be written before appended log prefix

This changes the logging format back to how it used to be before the event
logging changes.

7 years agolib: Add failure_context.log_prefix_type_pos
Timo Sirainen [Fri, 31 Aug 2018 12:03:37 +0000 (15:03 +0300)] 
lib: Add failure_context.log_prefix_type_pos

If non-zero, this specifies where the log type (e.g. "Info: ") is written
within the log prefix. By default it's appended.

7 years agolib, log: Add log prefix length to internal logging protocol
Timo Sirainen [Fri, 31 Aug 2018 12:01:38 +0000 (15:01 +0300)] 
lib, log: Add log prefix length to internal logging protocol

This way log process knows which part of the text is the log prefix, and
which part is the logged text.

7 years agolog: Move data stack frame allocation to parent function
Timo Sirainen [Fri, 31 Aug 2018 11:57:13 +0000 (14:57 +0300)] 
log: Move data stack frame allocation to parent function

This simplifies the next commit, which requires data stack nearly always
when logging. The data stack frames are cheap enough that we don't really
need to optimize for avoiding the cases when they're not needed.

7 years agolog: Avoid unnecessary global log prefix changes
Timo Sirainen [Fri, 31 Aug 2018 11:54:18 +0000 (14:54 +0300)] 
log: Avoid unnecessary global log prefix changes

If the context specifies a log prefix, the global prefix isn't going to be
used.

7 years agolib: failures - Use common log_prefix_add() for default and syslog formatters
Timo Sirainen [Fri, 31 Aug 2018 11:50:52 +0000 (14:50 +0300)] 
lib: failures - Use common log_prefix_add() for default and syslog formatters

7 years agolib: Add unit test for event log prefix handling
Timo Sirainen [Tue, 28 Aug 2018 09:45:23 +0000 (12:45 +0300)] 
lib: Add unit test for event log prefix handling

Some of the tests are commented out until they're fixed in a following
commit.

7 years agolib: failures - Move adding LF from default_format() to default_write()
Timo Sirainen [Fri, 31 Aug 2018 11:30:21 +0000 (14:30 +0300)] 
lib: failures - Move adding LF from default_format() to default_write()

This makes it similar to internal_format/write()

7 years agolib: Move failure handler structs and typedefs to failures-private.h
Timo Sirainen [Fri, 31 Aug 2018 11:21:06 +0000 (14:21 +0300)] 
lib: Move failure handler structs and typedefs to failures-private.h

Also change the function typedefs to be non-pointers, like they usually are
in Dovecot code.

7 years agolib: Make failure handler variables static
Timo Sirainen [Fri, 31 Aug 2018 11:19:32 +0000 (14:19 +0300)] 
lib: Make failure handler variables static

7 years agolib: Rename handler_config variable to failure_handler
Timo Sirainen [Fri, 31 Aug 2018 11:18:34 +0000 (14:18 +0300)] 
lib: Rename handler_config variable to failure_handler

It's a global variable, so it needs to have a proper prefix.

7 years agolib-master: stats_event_write use BEGIN only when event and parent_event create times...
Sergey Kitov [Tue, 16 Jan 2018 10:51:53 +0000 (12:51 +0200)] 
lib-master: stats_event_write use BEGIN only when event and parent_event create timestamps differ

7 years agolib: Add some event handling functions.
Sergey Kitov [Mon, 26 Feb 2018 14:33:19 +0000 (16:33 +0200)] 
lib: Add some event handling functions.

event_has_all_categories() - checks if given event contains all the
categories of an another event.
event_has_all_fields() - checks if given event contains all the fields
of an another event.
event_dup() - duplicates an event.
event_copy_categories_fields() - copies all categories and fields from
source to dest.

7 years agolib: Fix matching parent categories in event filter
Timo Sirainen [Fri, 31 Aug 2018 10:04:53 +0000 (13:04 +0300)] 
lib: Fix matching parent categories in event filter

So far this hasn't caused problems, because parent events had been using
parent categories. However, if the parent category wasn't used by an event
or its parents, an event filter wouldn't have matched it.

7 years agolib-http: Add assert to make sure http_client_init_shared(NULL, NULL) isn't called
Timo Sirainen [Thu, 30 Aug 2018 13:40:16 +0000 (16:40 +0300)] 
lib-http: Add assert to make sure http_client_init_shared(NULL, NULL) isn't called

This should make scan-build happy.

7 years agolib: Remove a dead assignment from test-array.c
Martti Rannanjärvi [Thu, 30 Aug 2018 13:14:34 +0000 (16:14 +0300)] 
lib: Remove a dead assignment from test-array.c

Found by scan-build.

7 years agolib: Implement vfuncs for logging to stderr
Sergey Kitov [Thu, 14 Jun 2018 12:54:03 +0000 (15:54 +0300)] 
lib: Implement vfuncs for logging to stderr

7 years agolib: Implement vfuncs for logging to syslog
Sergey Kitov [Thu, 14 Jun 2018 12:49:41 +0000 (15:49 +0300)] 
lib: Implement vfuncs for logging to syslog

7 years agolib: Implement vfuncs for logging to default location and common failure logging...
Sergey Kitov [Sun, 5 Aug 2018 01:00:17 +0000 (04:00 +0300)] 
lib: Implement vfuncs for logging to default location and common failure logging handling

7 years agolib: Introduce abstraction for failure logging implementations.
Sergey Kitov [Tue, 12 Jun 2018 12:56:46 +0000 (15:56 +0300)] 
lib: Introduce abstraction for failure logging implementations.

7 years agopop3: use array interface rather than internal buffer to access data
Phil Carmody [Thu, 30 Aug 2018 08:38:41 +0000 (11:38 +0300)] 
pop3: use array interface rather than internal buffer to access data

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agolib: test-array - tests that freeing without data doesn't free the data
Phil Carmody [Thu, 30 Aug 2018 08:36:08 +0000 (11:36 +0300)] 
lib: test-array - tests that freeing without data doesn't free the data

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agolib/array - give arrays the non-freeing deinit that strings and buffers have
Phil Carmody [Wed, 29 Aug 2018 12:28:31 +0000 (15:28 +0300)] 
lib/array - give arrays the non-freeing deinit that strings and buffers have

Buffers provide the ability to free the control block but preserve and
return the previously controlled data to the caller: buffer_free_without_data().

As wrapped buffers, strings also have this functionality: str_free_without_data().
(They have to do that, as their buffer implementation is encapsulated away
out of sight to the str.h user.)

Arrays, also wrapped buffers, are missing this capability under the 'array'
name, you have to use the buffer function call, which involves diving into
the guts of the array implementation (because arrays do not hide their
implementation like strings do), and also sacrifices array's type safety.

With this inline helper, it should be simple, obvious, clean and safe.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agom4/dovecot.m4: rename valgrind output file to hide it from certain tests
Phil Carmody [Tue, 19 Jun 2018 12:30:36 +0000 (15:30 +0300)] 
m4/dovecot.m4: rename valgrind output file to hide it from certain tests

Some lib-http tests use readdir() to create test cases, and sometimes
object to the contents of test.out.$$. However, as lib-http is also
sensitive to certain characters in the filenames of the files it uses,
we can hide the valgrind output by chosing its filename to exclude it
from the lib_http tests. Non-initial '~' is not known to cause any issues
for either the shell or any known operating system, so is the safest of
lib-http's 'dodgy' characters to use as the separator.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agom4/dovecot.m4 - Apply DRY principle to test output filename
Phil Carmody [Wed, 29 Aug 2018 11:57:45 +0000 (14:57 +0300)] 
m4/dovecot.m4 - Apply DRY principle to test output filename

Define the name we will use for the file once, then just use that variable
instead of using explicit repeatition.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agolib-http: increase pool sizes in tests
Phil Carmody [Tue, 19 Jun 2018 10:29:46 +0000 (13:29 +0300)] 
lib-http: increase pool sizes in tests

Pool growth messages spam the test output, just dive in with a slightly
larger default to shut them up. Only affects these individual tests,
not any other users of the library.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agolib-http: library default pool allocation increases
Phil Carmody [Wed, 29 Aug 2018 11:49:54 +0000 (14:49 +0300)] 
lib-http: library default pool allocation increases

Many pools will need to grow even when the smallest amount of work is
done within them, which can spam the logs.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agolib-http: change default client/server pool sizes when using SSL
Phil Carmody [Tue, 19 Jun 2018 10:28:12 +0000 (13:28 +0300)] 
lib-http: change default client/server pool sizes when using SSL

SSL carries a lot of state with it, so just start with a bigger
pool if we know we're using it.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agolib-http: harden payload tests against dodgy filenames
Phil Carmody [Thu, 14 Jun 2018 05:51:37 +0000 (08:51 +0300)] 
lib-http: harden payload tests against dodgy filenames

Tests use files from readdir() as input, but do no sanitation of the
names, and therefore things like editor temp files can cause havoc
with the HTTP request parser.

The solution is to trap dodgy characters in the filenames, and ignore
those files. Initially, trap HTTP's "unsafe" and "reserved" characters.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agolib: Fix documentation on POINTER_CAST
Aki Tuomi [Thu, 30 Aug 2018 08:54:29 +0000 (11:54 +0300)] 
lib: Fix documentation on POINTER_CAST

7 years agolib-master, master: Initialize stats-client via environment variables
Timo Sirainen [Wed, 29 Aug 2018 19:09:57 +0000 (22:09 +0300)] 
lib-master, master: Initialize stats-client via environment variables

That way it's initialized before settings are read, and it can catch events
earlier. It also doesn't require all services to read settings if they
otherwise don't need them.

7 years agodns: Fix duration field in dns_worker_request_finished event
Timo Sirainen [Wed, 29 Aug 2018 17:43:22 +0000 (20:43 +0300)] 
dns: Fix duration field in dns_worker_request_finished event

7 years agolib: connection - Clarify logging of incoming connections
Timo Sirainen [Mon, 27 Aug 2018 07:35:47 +0000 (10:35 +0300)] 
lib: connection - Clarify logging of incoming connections

Don't log "Client connected" for both incoming and outgoing connections.

7 years agolib: connection - Remove dead code
Timo Sirainen [Mon, 27 Aug 2018 07:33:54 +0000 (10:33 +0300)] 
lib: connection - Remove dead code

connection_client_connected() can only be called for clients. There was
already an assert for it.

7 years agodns: Remove duplicate event_unref() in dns_client_input_args()
Martti Rannanjärvi [Wed, 29 Aug 2018 14:27:58 +0000 (17:27 +0300)] 
dns: Remove duplicate event_unref() in dns_client_input_args()

The event is unreffed at the end of the function also.

7 years agodns: Return the lookup error string to the querier
Martti Rannanjärvi [Wed, 29 Aug 2018 14:22:22 +0000 (17:22 +0300)] 
dns: Return the lookup error string to the querier

7 years agolib-dns: Set error_r in dns_client_connect() on failure
Martti Rannanjärvi [Wed, 29 Aug 2018 10:40:33 +0000 (13:40 +0300)] 
lib-dns: Set error_r in dns_client_connect() on failure

7 years agolib-dns: Remove DNS from the log messages now that it's in the prefix
Martti Rannanjärvi [Wed, 29 Aug 2018 10:23:55 +0000 (13:23 +0300)] 
lib-dns: Remove DNS from the log messages now that it's in the prefix

7 years agolib-dns: Use dns(host): prefix instead of just host: in event
Martti Rannanjärvi [Wed, 29 Aug 2018 10:21:23 +0000 (13:21 +0300)] 
lib-dns: Use dns(host): prefix instead of just host: in event

7 years agolib: Use basename of unix socket path as event log prefix
Martti Rannanjärvi [Wed, 29 Aug 2018 08:04:10 +0000 (11:04 +0300)] 
lib: Use basename of unix socket path as event log prefix

This is to make the prefix consistent with other unix socket loggings in
Dovecot.

7 years agolib-smtp: client: Fix potential segfault occurring after receiving RCPT reply.
Stephan Bosch [Sun, 26 Aug 2018 13:16:17 +0000 (15:16 +0200)] 
lib-smtp: client: Fix potential segfault occurring after receiving RCPT reply.

Could occur when RCPT reply is received befor DATA command is sent in LMTP session.

Problem found by Coverity.

7 years agolib-dns - struct member cleanup in dns_lookup
Phil Carmody [Wed, 29 Aug 2018 12:15:30 +0000 (15:15 +0300)] 
lib-dns - struct member cleanup in dns_lookup

The index was never used anyway. Now we're using an alloconly pool,
there's no need for the dns_lookup to keep a freeable pointer to the
fields also int result.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agoquota: Mark noenforcing quotas with unlimited quota
Aki Tuomi [Tue, 24 Jul 2018 11:47:47 +0000 (14:47 +0300)] 
quota: Mark noenforcing quotas with unlimited quota

This allows quota to be properly updated for unenforced quotas
so they can be used for tracking only.

This fixes issue where using noenforcing would not update quota
during mail save, but requires a manual quota update.

7 years agoquota: Cleanup - Move enforce checking out of quota_root_visible()
Aki Tuomi [Tue, 24 Jul 2018 11:38:18 +0000 (14:38 +0300)] 
quota: Cleanup - Move enforce checking out of quota_root_visible()

Non-enforcing quota roots need to be visible even when enforcing quotas,
otherwise we cannot update them.

7 years agolib: Use i_asserts() for NULL-checks in test_event_filter_inc_int()
Martti Rannanjärvi [Tue, 28 Aug 2018 09:00:54 +0000 (12:00 +0300)] 
lib: Use i_asserts() for NULL-checks in test_event_filter_inc_int()

This is so scan-build doesn't explore the assertations not holding and
create noise with that.

7 years agofts: Optimize replacing NULs in header
Timo Sirainen [Mon, 27 Aug 2018 12:06:44 +0000 (15:06 +0300)] 
fts: Optimize replacing NULs in header