]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
7 years agoquota: Make quota_get_result errors <= QUOTA_GET_RESULT_INTERNAL_ERROR
Martti Rannanjärvi [Thu, 2 Nov 2017 14:20:39 +0000 (16:20 +0200)] 
quota: Make quota_get_result errors <= QUOTA_GET_RESULT_INTERNAL_ERROR

Reorder the enum to make a shortcut for distinguishing errors.

7 years agoquota-dict: Cleanup dict_quota_get_resource() whitespace
Martti Rannanjärvi [Thu, 2 Nov 2017 14:30:31 +0000 (16:30 +0200)] 
quota-dict: Cleanup dict_quota_get_resource() whitespace

7 years agoquota-clone: Rename ret_bytes and ret_count to bytes_res and count_res
Martti Rannanjärvi [Wed, 20 Sep 2017 09:32:40 +0000 (12:32 +0300)] 
quota-clone: Rename ret_bytes and ret_count to bytes_res and count_res

This is because the variables do not contain the actual quota resource
values but whether the lookup was successful.

7 years agolib: test-istream-jsonstr - Improve unit test
Timo Sirainen [Mon, 6 Nov 2017 19:00:57 +0000 (21:00 +0200)] 
lib: test-istream-jsonstr - Improve unit test

7 years agodoveadm-server: Fix protocol handshake order
Timo Sirainen [Wed, 8 Nov 2017 12:06:00 +0000 (14:06 +0200)] 
doveadm-server: Fix protocol handshake order

With version 1.1 protocol, server sent the authentication "+" or "-" line
before the VERSION. doveadm client accepts the VERSION reply either before
or after, so this change doesn't break it. It makes the protocol cleaner
though.

Based on patch by Manuel Mausz

7 years agodoveadm-server: Add client_connection_tcp.preauthenticated
Timo Sirainen [Wed, 8 Nov 2017 12:04:12 +0000 (14:04 +0200)] 
doveadm-server: Add client_connection_tcp.preauthenticated

7 years agolib-ssl-iostream: Simplify ssl_iostream_settings_equals()
Timo Sirainen [Wed, 8 Nov 2017 00:31:03 +0000 (02:31 +0200)] 
lib-ssl-iostream: Simplify ssl_iostream_settings_equals()

7 years agodirector: Add director_max_parallel_moves/kicks settings
Timo Sirainen [Tue, 7 Nov 2017 15:36:05 +0000 (17:36 +0200)] 
director: Add director_max_parallel_moves/kicks settings

The director_max_parallel_moves setting controls the default limit, which
can still be increased by explicitly using the doveadm director flush
--max-parallel" parameter.

7 years agolib: istream-jsonstr - Properly handle unicode input
Aki Tuomi [Fri, 3 Nov 2017 11:26:52 +0000 (13:26 +0200)] 
lib: istream-jsonstr - Properly handle unicode input

Treat surrogates correctly, do not accept invalid codepoints

7 years agolib: istream-jsonstr - Move length check to unescape
Aki Tuomi [Fri, 3 Nov 2017 11:23:15 +0000 (13:23 +0200)] 
lib: istream-jsonstr - Move length check to unescape

7 years agolib: json-parser - check for valid hex in unicode escape
Aki Tuomi [Mon, 6 Nov 2017 12:40:08 +0000 (14:40 +0200)] 
lib: json-parser - check for valid hex in unicode escape

7 years agolib: json-parser - Insert properly escaped unicode
Aki Tuomi [Fri, 3 Nov 2017 07:50:40 +0000 (09:50 +0200)] 
lib: json-parser - Insert properly escaped unicode

7 years agoconfigure: Fix writing LIBDOVECOT[_DEPS] in dovecot-config
Timo Sirainen [Tue, 7 Nov 2017 16:28:37 +0000 (18:28 +0200)] 
configure: Fix writing LIBDOVECOT[_DEPS] in dovecot-config

It needs to be in a single line or DC_DOVECOT's greping doesn't work
correctly.

7 years agodirector: Limit max kicking count
Aki Tuomi [Mon, 6 Nov 2017 08:36:07 +0000 (10:36 +0200)] 
director: Limit max kicking count

7 years agodirector: Add kick_callback to director
Aki Tuomi [Tue, 7 Nov 2017 12:34:32 +0000 (14:34 +0200)] 
director: Add kick_callback to director

This callback gets called whenever director has performed
a kick.

7 years ago*-login: Add login_proxy_notify_path setting to configure proxy-notify path
Timo Sirainen [Fri, 27 Oct 2017 13:45:16 +0000 (16:45 +0300)] 
*-login: Add login_proxy_notify_path setting to configure proxy-notify path

A single FIFO can be a bottleneck, so this could be set to e.g.:

login_proxy_notify_path = proxy-notify%1R{pid}

or:

login_proxy_notify_path = proxy-notify%10N{pid}

7 years agodirector: Allow proxy-notify to optionally be a socket
Timo Sirainen [Fri, 27 Oct 2017 13:24:54 +0000 (16:24 +0300)] 
director: Allow proxy-notify to optionally be a socket

Dovecot isn't using this currently, but it can be useful if external
services want to send notifications.

7 years agodirector: Support multiple proxy-notify connections
Timo Sirainen [Fri, 27 Oct 2017 13:20:15 +0000 (16:20 +0300)] 
director: Support multiple proxy-notify connections

7 years agoquota-fs: Make it possible to set the mount= parameter
Martti Rannanjärvi [Tue, 7 Nov 2017 01:57:49 +0000 (03:57 +0200)] 
quota-fs: Make it possible to set the mount= parameter

Also free root->storage_mount_path before copying the given parameter in
order not to leak memory when there are duplicate mount= parameters.

7 years agolog: Fix log reopening on SIGUSR1
Timo Sirainen [Mon, 6 Nov 2017 23:33:57 +0000 (01:33 +0200)] 
log: Fix log reopening on SIGUSR1

7 years agolib-ssl-iostream: Remove obsolete ssl_iostream_context_deinit()
Timo Sirainen [Mon, 6 Nov 2017 23:11:33 +0000 (01:11 +0200)] 
lib-ssl-iostream: Remove obsolete ssl_iostream_context_deinit()

7 years agoglobal: Replace ssl_iostream_context_init_client() with ssl_iostream_client_context_c...
Timo Sirainen [Sun, 5 Nov 2017 16:35:57 +0000 (18:35 +0200)] 
global: Replace ssl_iostream_context_init_client() with ssl_iostream_client_context_cache_get()

7 years agolib-ssl-iostream: Call ssl_iostream_context_cache_free() automatically at exit
Timo Sirainen [Sun, 5 Nov 2017 16:34:48 +0000 (18:34 +0200)] 
lib-ssl-iostream: Call ssl_iostream_context_cache_free() automatically at exit

7 years agolib: Remove net_transmit()
Timo Sirainen [Thu, 2 Nov 2017 21:36:57 +0000 (23:36 +0200)] 
lib: Remove net_transmit()

Its API was confusing, and it's no longer used anywhere.

7 years agologin-common: Remove ssl-proxy code
Timo Sirainen [Tue, 31 Oct 2017 23:51:14 +0000 (01:51 +0200)] 
login-common: Remove ssl-proxy code

7 years agologin-common: Stop using ssl-proxy entirely
Timo Sirainen [Tue, 31 Oct 2017 23:49:57 +0000 (01:49 +0200)] 
login-common: Stop using ssl-proxy entirely

7 years ago*-login: Remove unnecessary ssl-proxy.h include
Timo Sirainen [Tue, 31 Oct 2017 23:49:04 +0000 (01:49 +0200)] 
*-login: Remove unnecessary ssl-proxy.h include

7 years agologin-common: Call io_stream_ssl_global_init() early
Timo Sirainen [Tue, 31 Oct 2017 23:47:54 +0000 (01:47 +0200)] 
login-common: Call io_stream_ssl_global_init() early

7 years agologin-common: Use lib-ssl-iostream for incoming SSL/TLS connections
Timo Sirainen [Tue, 31 Oct 2017 23:27:36 +0000 (01:27 +0200)] 
login-common: Use lib-ssl-iostream for incoming SSL/TLS connections

7 years agolib-ssl-iostream: Add io_stream_ssl_global_init()
Timo Sirainen [Tue, 31 Oct 2017 23:40:23 +0000 (01:40 +0200)] 
lib-ssl-iostream: Add io_stream_ssl_global_init()

7 years agolib-ssl-iostream: io_stream_create_ssl_client() - Move code to set verify_remote_cert...
Timo Sirainen [Tue, 31 Oct 2017 23:38:19 +0000 (01:38 +0200)] 
lib-ssl-iostream: io_stream_create_ssl_client() - Move code to set verify_remote_cert=TRUE

Enable it in the generic SSL code instead of OpenSSL-specific code.

7 years ago*-login: Use io_add_istream() instead of io_add()
Timo Sirainen [Tue, 31 Oct 2017 23:21:38 +0000 (01:21 +0200)] 
*-login: Use io_add_istream() instead of io_add()

7 years agologin-common: Change process title to show different connection types
Timo Sirainen [Wed, 1 Nov 2017 20:48:55 +0000 (22:48 +0200)] 
login-common: Change process title to show different connection types

Separate pre-login connections, proxy connections and post-login TLS
proxies.

7 years agologin-common: Destroy all fd proxies at deinit.
Timo Sirainen [Wed, 1 Nov 2017 20:40:58 +0000 (22:40 +0200)] 
login-common: Destroy all fd proxies at deinit.

7 years agologin-common: Implement post-login proxying and use it with SSL connections
Timo Sirainen [Wed, 1 Nov 2017 00:19:51 +0000 (02:19 +0200)] 
login-common: Implement post-login proxying and use it with SSL connections

Note: This temporarily breaks the SSL connections a bit. If post-login
process disconnects the client, it's not noticed by the login process.
Client connections are noticed by the post-login though.

7 years agologin-common: client_alloc() - remove unnecessary ssl parameter
Timo Sirainen [Tue, 31 Oct 2017 23:06:05 +0000 (01:06 +0200)] 
login-common: client_alloc() - remove unnecessary ssl parameter

7 years agologin-common: Use client_init_ssl() to initialize all SSL connections
Timo Sirainen [Tue, 31 Oct 2017 23:03:31 +0000 (01:03 +0200)] 
login-common: Use client_init_ssl() to initialize all SSL connections

7 years agologin-common: Extract SSL/TLS initialization into client_init_ssl()
Timo Sirainen [Tue, 31 Oct 2017 22:59:54 +0000 (00:59 +0200)] 
login-common: Extract SSL/TLS initialization into client_init_ssl()

7 years agologin-common: Split client_create() to client_alloc() and client_init()
Timo Sirainen [Tue, 31 Oct 2017 22:49:53 +0000 (00:49 +0200)] 
login-common: Split client_create() to client_alloc() and client_init()

client_unref() can be used to free an allocated client that hasn't been
fully created.

7 years agolib-ssl-iostream: Add TLS SNI callback and a way to change SSL context
Timo Sirainen [Wed, 1 Nov 2017 23:05:01 +0000 (01:05 +0200)] 
lib-ssl-iostream: Add TLS SNI callback and a way to change SSL context

7 years agolib-ssl-iostream: ssl_iostream_cert_match_name() - add reason_r parameter
Timo Sirainen [Tue, 31 Oct 2017 22:18:23 +0000 (00:18 +0200)] 
lib-ssl-iostream: ssl_iostream_cert_match_name() - add reason_r parameter

The callers were also changed to add the reason to error messages.

7 years agolib-ssl-iostream: openssl_cert_match_name() - add reason_r parameter
Timo Sirainen [Tue, 31 Oct 2017 22:12:24 +0000 (00:12 +0200)] 
lib-ssl-iostream: openssl_cert_match_name() - add reason_r parameter

The returned string explains what exactly matched or why nothing matched.

7 years agolib-ssl-iostream: ssl_iostream_cert_match_name() - Change to return bool
Timo Sirainen [Tue, 31 Oct 2017 22:08:26 +0000 (00:08 +0200)] 
lib-ssl-iostream: ssl_iostream_cert_match_name() - Change to return bool

The return value makes much more sense as a boolean TRUE/FALSE than 0/-1.

7 years agologin-proxy: Use lib-ssl-iostream for outgoing SSL/TLS connections
Timo Sirainen [Tue, 31 Oct 2017 17:34:05 +0000 (19:34 +0200)] 
login-proxy: Use lib-ssl-iostream for outgoing SSL/TLS connections

7 years agolib-master: master_service_ssl_settings_to_iostream_set() - add client/server parameter
Timo Sirainen [Tue, 31 Oct 2017 22:35:33 +0000 (00:35 +0200)] 
lib-master: master_service_ssl_settings_to_iostream_set() - add client/server parameter

7 years agolib-master: master_service_ssl_settings_to_iostream_set() - reorder assignments
Timo Sirainen [Tue, 31 Oct 2017 21:24:17 +0000 (23:24 +0200)] 
lib-master: master_service_ssl_settings_to_iostream_set() - reorder assignments

Keep them in the same order as the fields in struct ssl_iostream_settings,
so it's easier to verify whether all fields are listed.

7 years agolib-master: master_service_ssl_settings_to_iostream_set() - add ssl_require_crl
Timo Sirainen [Tue, 31 Oct 2017 21:23:10 +0000 (23:23 +0200)] 
lib-master: master_service_ssl_settings_to_iostream_set() - add ssl_require_crl

7 years agolib-master: master_service_ssl_settings_to_iostream_set() - don't go through master_s...
Timo Sirainen [Tue, 31 Oct 2017 16:57:29 +0000 (18:57 +0200)] 
lib-master: master_service_ssl_settings_to_iostream_set() - don't go through master_service

It's more useful to convert any master_service_ssl_settings struct.

7 years agolib-master: Add ssl_client_ca_file & _dir to master_service_ssl_settings
Timo Sirainen [Tue, 31 Oct 2017 22:26:02 +0000 (00:26 +0200)] 
lib-master: Add ssl_client_ca_file & _dir to master_service_ssl_settings

7 years agolib-ssl-iostream: Add ssl_iostream_context cache
Timo Sirainen [Wed, 1 Nov 2017 23:04:00 +0000 (01:04 +0200)] 
lib-ssl-iostream: Add ssl_iostream_context cache

This can be used to easily get a shared ssl_iostream_context for either
server or client. There's no upper size limit for the cache.

7 years agolib-ssl-iostream: Add ssl_iostream_settings_drop_stream_only()
Timo Sirainen [Sun, 5 Nov 2017 16:30:42 +0000 (18:30 +0200)] 
lib-ssl-iostream: Add ssl_iostream_settings_drop_stream_only()

7 years agolib-ssl-iostream: Add ssl_iostream_settings_equals()
Timo Sirainen [Sun, 5 Nov 2017 16:29:13 +0000 (18:29 +0200)] 
lib-ssl-iostream: Add ssl_iostream_settings_equals()

7 years agolib-ssl-iostream: Keep ssl_iostream_context referenced while it has streams
Timo Sirainen [Tue, 31 Oct 2017 16:43:22 +0000 (18:43 +0200)] 
lib-ssl-iostream: Keep ssl_iostream_context referenced while it has streams

7 years agolib-ssl-iostream: Add refcounting to ssl_iostream_context
Timo Sirainen [Tue, 31 Oct 2017 16:41:47 +0000 (18:41 +0200)] 
lib-ssl-iostream: Add refcounting to ssl_iostream_context

7 years agoglobal: Rename ssl_iostream_context_deinit() to ssl_iostream_context_unref()
Timo Sirainen [Tue, 31 Oct 2017 16:39:39 +0000 (18:39 +0200)] 
global: Rename ssl_iostream_context_deinit() to ssl_iostream_context_unref()

7 years agolib-ssl-iostream: Change ssl_iostream_context.set to not be a pointer
Timo Sirainen [Mon, 30 Oct 2017 14:55:43 +0000 (16:55 +0200)] 
lib-ssl-iostream: Change ssl_iostream_context.set to not be a pointer

It's just unnecessary memory usage.

7 years agolib-ssl-iostream: ssl_iostream_settings_dup() - rewrite using string offsets array
Timo Sirainen [Tue, 31 Oct 2017 16:19:33 +0000 (18:19 +0200)] 
lib-ssl-iostream: ssl_iostream_settings_dup() - rewrite using string offsets array

This array will be useful for other purposes as well.

7 years agolib-ssl-iostream: Add ssl_iostream_settings_init_from()
Timo Sirainen [Mon, 30 Oct 2017 14:54:34 +0000 (16:54 +0200)] 
lib-ssl-iostream: Add ssl_iostream_settings_init_from()

This allows duplicating settings to an already existing struct without
having to allocate it.

7 years agolib-ssl-iostream: ssl_iostream_settings_dup() - duplicate also dh
Timo Sirainen [Mon, 30 Oct 2017 10:57:40 +0000 (12:57 +0200)] 
lib-ssl-iostream: ssl_iostream_settings_dup() - duplicate also dh

7 years agolib-ssl-iostream: Add stream/context comments to all ssl_iostream_settings
Timo Sirainen [Mon, 30 Oct 2017 10:06:01 +0000 (12:06 +0200)] 
lib-ssl-iostream: Add stream/context comments to all ssl_iostream_settings

7 years agologin-proxy: Use iostream-proxy API to perform proxying
Timo Sirainen [Sun, 29 Oct 2017 22:44:41 +0000 (00:44 +0200)] 
login-proxy: Use iostream-proxy API to perform proxying

7 years agolib: Add o_stream_get_last_write_time()
Timo Sirainen [Sun, 29 Oct 2017 22:59:01 +0000 (00:59 +0200)] 
lib: Add o_stream_get_last_write_time()

7 years agolib: Add i_stream_get_last_read_time()
Timo Sirainen [Sun, 29 Oct 2017 22:49:15 +0000 (00:49 +0200)] 
lib: Add i_stream_get_last_read_time()

7 years agologin-proxy: Move client fd closing to client_unref()
Timo Sirainen [Wed, 1 Nov 2017 21:53:42 +0000 (23:53 +0200)] 
login-proxy: Move client fd closing to client_unref()

7 years agologin-common: Move code in client_destroy_internal_failure() to its only caller
Timo Sirainen [Wed, 1 Nov 2017 19:15:53 +0000 (21:15 +0200)] 
login-common: Move code in client_destroy_internal_failure() to its only caller

No need to have a function that has only a single caller.

7 years agologin-common: Avoid using client_destroy_success() when mail_max_userip_connections...
Timo Sirainen [Wed, 1 Nov 2017 19:09:56 +0000 (21:09 +0200)] 
login-common: Avoid using client_destroy_success() when mail_max_userip_connections is reached

This was currently the only way how data != NULL here.

This change destroys ssl_proxy on client_destroy() instead of
client_unref(), but that doesn't make much of a practical difference. This
new behavior is a bit more correct though.

7 years agoiostream-openssl: Refactor stream sync code
Aki Tuomi [Tue, 4 Oct 2016 12:36:06 +0000 (15:36 +0300)] 
iostream-openssl: Refactor stream sync code

When doing input or stream sync, specify
the type of operation that we are doing
to make sure we do IO correctly.

7 years agolib-ssl-iostream: Set error on clean connection closing during handshake.
Timo Sirainen [Sun, 5 Nov 2017 16:07:28 +0000 (18:07 +0200)] 
lib-ssl-iostream: Set error on clean connection closing during handshake.

Set the error to "SSL connection closed during handshake".

7 years agolib-ssl-iostream: Cleanup disconnection handling
Timo Sirainen [Sun, 5 Nov 2017 16:06:10 +0000 (18:06 +0200)] 
lib-ssl-iostream: Cleanup disconnection handling

Avoid code duplication. Set error to "Connection closed" if there's no
other error.

7 years agodoveadm: Remove dead code
Timo Sirainen [Sun, 5 Nov 2017 15:47:15 +0000 (17:47 +0200)] 
doveadm: Remove dead code

ret can never be >0 at this point. If there are any unexpected JSON
elements, doveadm_http_server_json_parse_v1() returns -1.

7 years agodirector: Make sure HOST-RESET-USERS isn't used with max_moving_users=0
Timo Sirainen [Sun, 5 Nov 2017 21:51:56 +0000 (23:51 +0200)] 
director: Make sure HOST-RESET-USERS isn't used with max_moving_users=0

The reset command would just hang in that case. doveadm would never have
sent this, so this is just an extra sanity check.

7 years agodirector: Show in process title how many users are being kicked.
Timo Sirainen [Sun, 5 Nov 2017 21:27:36 +0000 (23:27 +0200)] 
director: Show in process title how many users are being kicked.

7 years agodirector: Show in process title how many requests are being delayed.
Timo Sirainen [Sun, 5 Nov 2017 21:01:56 +0000 (23:01 +0200)] 
director: Show in process title how many requests are being delayed.

7 years agodirector: Log an error if login process sends unexpected reply to KICK* commands
Timo Sirainen [Mon, 6 Nov 2017 08:57:03 +0000 (10:57 +0200)] 
director: Log an error if login process sends unexpected reply to KICK* commands

7 years agodirector: Log whenever HOST-RESET-USERS is used
Timo Sirainen [Sun, 5 Nov 2017 20:53:23 +0000 (22:53 +0200)] 
director: Log whenever HOST-RESET-USERS is used

7 years agodirector: Include used CPU secs in director connection log messages
Timo Sirainen [Sun, 5 Nov 2017 20:38:27 +0000 (22:38 +0200)] 
director: Include used CPU secs in director connection log messages

It's counting the process's full CPU seconds used since the handshake
started, so it's not specific to the connection itself. Still, this is
likely to be very useful in debugging whether a slow handshake was due
to CPU usage or something else.

7 years agodirector: Deduplicate code into director_connection_set_connected()
Timo Sirainen [Sun, 5 Nov 2017 20:37:27 +0000 (22:37 +0200)] 
director: Deduplicate code into director_connection_set_connected()

7 years agodirector: Include peak output buffer size in director connection log messages
Timo Sirainen [Sun, 5 Nov 2017 20:27:41 +0000 (22:27 +0200)] 
director: Include peak output buffer size in director connection log messages

7 years agocassandra: Include the used timestamp in logged queries
Timo Sirainen [Sat, 4 Nov 2017 12:33:52 +0000 (14:33 +0200)] 
cassandra: Include the used timestamp in logged queries

7 years agocassandra: Rename cassandra_sql_statement.pending_timestamp to just timestamp
Timo Sirainen [Mon, 6 Nov 2017 09:00:06 +0000 (11:00 +0200)] 
cassandra: Rename cassandra_sql_statement.pending_timestamp to just timestamp

7 years agolib-storage: When copying mails, copy also empty cache fields
Timo Sirainen [Mon, 6 Nov 2017 16:59:34 +0000 (18:59 +0200)] 
lib-storage: When copying mails, copy also empty cache fields

This mainly means that it copies cache fields for nonexistent message
headers. Those are still important, because otherwise Dovecot doesn't know
whether they exist or not.

7 years agodirector: Don't block too long when sending users during director handshake
Timo Sirainen [Sun, 5 Nov 2017 23:30:13 +0000 (01:30 +0200)] 
director: Don't block too long when sending users during director handshake

All the other work is blocked while the users are being sent.

7 years agoauth: Disabling SMTP authentication in vpopmail users with NO_SMTP flag
Taizo Ito [Wed, 26 Jul 2017 09:34:59 +0000 (18:34 +0900)] 
auth: Disabling SMTP authentication in vpopmail users with NO_SMTP flag

7 years agolib: str_parse/to_*int*() - minor optimization
Timo Sirainen [Sun, 5 Nov 2017 19:36:55 +0000 (21:36 +0200)] 
lib: str_parse/to_*int*() - minor optimization

7 years agodirector: Avoid str_printfa() in director_connection_send_users()
Timo Sirainen [Sat, 4 Nov 2017 13:29:29 +0000 (15:29 +0200)] 
director: Avoid str_printfa() in director_connection_send_users()

Optimizes the CPU usage.

7 years agodirector: Avoid str_printfa() in login_host_callback()
Timo Sirainen [Sat, 4 Nov 2017 00:17:55 +0000 (02:17 +0200)] 
director: Avoid str_printfa() in login_host_callback()

Optimizes the CPU usage.

7 years agodirector: Change request callback to take mail_host parameter
Timo Sirainen [Sat, 4 Nov 2017 00:05:26 +0000 (02:05 +0200)] 
director: Change request callback to take mail_host parameter

This allows accessing the IP address both as struct and as string without
any conversions.

7 years agodirector: Use *_host.ip_str to avoid net_ip2addr() calls
Timo Sirainen [Fri, 3 Nov 2017 23:59:27 +0000 (01:59 +0200)] 
director: Use *_host.ip_str to avoid net_ip2addr() calls

7 years agodirector: Add director_host.ip_str
Timo Sirainen [Fri, 3 Nov 2017 23:51:25 +0000 (01:51 +0200)] 
director: Add director_host.ip_str

This avoids having to use net_ip2addr() all the time to convert it into a
string.

7 years agodirector: Add mail_host.ip_str
Timo Sirainen [Fri, 3 Nov 2017 23:49:29 +0000 (01:49 +0200)] 
director: Add mail_host.ip_str

This avoids having to use net_ip2addr() all the time to convert it into a
string.

7 years agodirector: Use t_strsplit_tabescaped_inplace() for director connection input
Timo Sirainen [Fri, 3 Nov 2017 23:48:41 +0000 (01:48 +0200)] 
director: Use t_strsplit_tabescaped_inplace() for director connection input

7 years agolib: net_addr2ip() - Optimize for parsing IPv4 addresses
Timo Sirainen [Fri, 3 Nov 2017 23:43:41 +0000 (01:43 +0200)] 
lib: net_addr2ip() - Optimize for parsing IPv4 addresses

7 years agolib: net_ip2addr() - Optimize by allocating destination memory immediately
Timo Sirainen [Fri, 3 Nov 2017 23:42:37 +0000 (01:42 +0200)] 
lib: net_ip2addr() - Optimize by allocating destination memory immediately

It doesn't really matter if we allocate a few extra bytes.

7 years agolib: *_strsplit() - implement more efficient version for a single separator char
Timo Sirainen [Fri, 3 Nov 2017 23:40:24 +0000 (01:40 +0200)] 
lib: *_strsplit() - implement more efficient version for a single separator char

7 years agolib: test-strfuncs - Improve *_strsplit*() unit tests
Timo Sirainen [Sun, 5 Nov 2017 19:30:30 +0000 (21:30 +0200)] 
lib: test-strfuncs - Improve *_strsplit*() unit tests

7 years agolib: Implement t_strsplit_tabescaped_inplace()
Timo Sirainen [Fri, 3 Nov 2017 23:39:38 +0000 (01:39 +0200)] 
lib: Implement t_strsplit_tabescaped_inplace()

This is a more efficient version of t_strsplit_tabescaped(), which modifies
the input string instead of duplicating it.

7 years agolib: test-strescape - Refactor the unit test to use an array of tests
Timo Sirainen [Sun, 5 Nov 2017 19:14:41 +0000 (21:14 +0200)] 
lib: test-strescape - Refactor the unit test to use an array of tests

7 years agolib: t_strsplit_tabescaped() - don't create unnecessary data stack mempool
Timo Sirainen [Fri, 3 Nov 2017 23:37:19 +0000 (01:37 +0200)] 
lib: t_strsplit_tabescaped() - don't create unnecessary data stack mempool

unsafe_data_stack_pool is more efficient to use

7 years agolib: str_tabunescape() - optimize initial escape char lookup
Timo Sirainen [Fri, 3 Nov 2017 23:35:44 +0000 (01:35 +0200)] 
lib: str_tabunescape() - optimize initial escape char lookup

strchr() is faster than looping ourself.

7 years agodirector: Don't recreate timeout on every user lookup
Timo Sirainen [Fri, 3 Nov 2017 23:34:02 +0000 (01:34 +0200)] 
director: Don't recreate timeout on every user lookup

Recreate it only when the timeout should change.