]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
7 years agolib: Add i_stream_free_buffer() to free i_stream_*alloc()ed memory
Timo Sirainen [Thu, 26 Oct 2017 13:24:50 +0000 (16:24 +0300)] 
lib: Add i_stream_free_buffer() to free i_stream_*alloc()ed memory

7 years agolib: Add memarea API
Timo Sirainen [Fri, 8 Sep 2017 10:33:27 +0000 (13:33 +0300)] 
lib: Add memarea API

This can be used to create reference counted memory areas where a callback
is called once the refcount drops to zero.

7 years agolib: istream-chain/concat cleanup - return early if no new data is read
Timo Sirainen [Thu, 26 Oct 2017 11:56:26 +0000 (14:56 +0300)] 
lib: istream-chain/concat cleanup - return early if no new data is read

There's no need to change the buffer or other variables. This simplifies
the following changes.

This cleanup is identical for istream-concat and istream-chain.

7 years agolib-mail: istream-header-filter - Fix header read() when max_buffer_size=0
Timo Sirainen [Fri, 20 Jan 2017 15:34:50 +0000 (17:34 +0200)] 
lib-mail: istream-header-filter - Fix header read() when max_buffer_size=0

If the buffer was too small to read anything into it, read_header() returned
-2, but then it continued reading the header as if it was the body already.
This should instead be an error situation - max buffer size just shouldn't be
0 at this point.

This was originally changed in a72355fef49c512c13b7d8c3e07f4f76ebd57a10 as
some kind of a workaround, but since then we implemented support for reading
a mixed header/body in c2afdbf963d0564a542d71ca784deb0c2f7776d0.

7 years agoimap: Set max buffer size for CATENATE istream-chain
Timo Sirainen [Mon, 30 Oct 2017 11:58:54 +0000 (13:58 +0200)] 
imap: Set max buffer size for CATENATE istream-chain

This fixes a crash with mbox when nonexistent CATENATE URL is attempted to
be used. The istream doesn't get any size, and istream-header-filter panics
due to having reached the maximum buffer size (0), even though the stream is
empty and there's nothing to read.

7 years agolib: Add assert to io_stream_ref()
Timo Sirainen [Fri, 20 Jan 2017 14:28:53 +0000 (16:28 +0200)] 
lib: Add assert to io_stream_ref()

This makes an assert-crash likely to happen if iostream was already freed.

7 years agodoveadm: Ignore errors also on outgoing SSL connection ostreams
Timo Sirainen [Wed, 1 Nov 2017 11:01:03 +0000 (13:01 +0200)] 
doveadm: Ignore errors also on outgoing SSL connection ostreams

Setting the errors as ignored on the plain ostream was done too late, so ssl
ostream didn't inherit the error handling flag.

7 years agolib: iostream-proxy - Specify what failed in completion callback parameter
Timo Sirainen [Sun, 29 Oct 2017 22:30:13 +0000 (00:30 +0200)] 
lib: iostream-proxy - Specify what failed in completion callback parameter

7 years agolib: iostream-pump - Specify what failed in completion callback parameter
Timo Sirainen [Sun, 29 Oct 2017 22:16:35 +0000 (00:16 +0200)] 
lib: iostream-pump - Specify what failed in completion callback parameter

This makes it easier for the caller to find out whether the failure was due
to istream or ostream.

7 years agolib: iostream-proxy - Add iostream_proxy_is_waiting_output()
Timo Sirainen [Sun, 29 Oct 2017 21:53:16 +0000 (23:53 +0200)] 
lib: iostream-proxy - Add iostream_proxy_is_waiting_output()

7 years agolib: iostream-pump - Add iostream_pump_is_waiting_output()
Timo Sirainen [Sun, 29 Oct 2017 21:53:00 +0000 (23:53 +0200)] 
lib: iostream-pump - Add iostream_pump_is_waiting_output()

7 years agolib: iostream-pump - Fix crash in iostream_pump_switch_ioloop() if io is NULL
Timo Sirainen [Sun, 29 Oct 2017 23:07:36 +0000 (01:07 +0200)] 
lib: iostream-pump - Fix crash in iostream_pump_switch_ioloop() if io is NULL

This would happen when the pump's ostream is full and it has stopped
listening for input.

7 years agolib: iostream-pump - Cork the ostream when writing
Timo Sirainen [Sun, 29 Oct 2017 21:28:38 +0000 (23:28 +0200)] 
lib: iostream-pump - Cork the ostream when writing

This reduces latency for TCP connections by disabling Nagle algorithm.

7 years agodoveadm-server: Deinitialize log proxying before closing SSL iostream
Timo Sirainen [Tue, 31 Oct 2017 18:05:19 +0000 (20:05 +0200)] 
doveadm-server: Deinitialize log proxying before closing SSL iostream

Otherwise the SSL iostream destroying may trigger debug/error logging,
which attempts to proxy logs when the stream is already closed. This
caused a panic.

7 years agodbox: Don't finish dbox's ostream when mail is saved
Timo Sirainen [Tue, 31 Oct 2017 17:24:21 +0000 (19:24 +0200)] 
dbox: Don't finish dbox's ostream when mail is saved

Fixes assert-crash when saving mail when using zlib plugin.

7 years agolib-compression: Fix unit test to not crash
Timo Sirainen [Tue, 31 Oct 2017 15:27:05 +0000 (17:27 +0200)] 
lib-compression: Fix unit test to not crash

7 years agolib-mail: ostream-dot - Set o_stream_set_finish_also_parent(FALSE) by default
Timo Sirainen [Tue, 31 Oct 2017 15:24:06 +0000 (17:24 +0200)] 
lib-mail: ostream-dot - Set o_stream_set_finish_also_parent(FALSE) by default

ostream-dot is always used inside another ostream to implement some kind of
data escaping. The ostream-dot always has to be finished to write the "."
line, but the caller never wants it to finish the parent stream.

7 years agolib-fs: fs-metawrap - Don't try to write to an already finished ostream
Timo Sirainen [Tue, 31 Oct 2017 15:20:22 +0000 (17:20 +0200)] 
lib-fs: fs-metawrap - Don't try to write to an already finished ostream

Fixes a crash after recent changes when trying to write an empty file via
fs-metawrap.

7 years agolib: connection - Use o_stream_set_finish_via_child(FALSE)
Timo Sirainen [Tue, 31 Oct 2017 15:09:47 +0000 (17:09 +0200)] 
lib: connection - Use o_stream_set_finish_via_child(FALSE)

This allows o_stream_finish() calls on child streams without closing this
parent stream. Since the stream has no error checking by default anyway,
this allows the connection stream to be used more easily.

7 years agolib: Add o_stream_set_finish_also_parent() and _finish_via_child()
Timo Sirainen [Tue, 31 Oct 2017 15:07:44 +0000 (17:07 +0200)] 
lib: Add o_stream_set_finish_also_parent() and _finish_via_child()

These allow controlling on both directions whether o_stream_finish() should
be finishing the parent stream. If either one is set to FALSE, the parent
stream isn't finished. Which one of these to use depends on the situation.

7 years agoglobal: Use o_stream_flush_parent()
Timo Sirainen [Tue, 31 Oct 2017 13:05:01 +0000 (15:05 +0200)] 
global: Use o_stream_flush_parent()

7 years agolib: Add o_stream_flush_parent()
Timo Sirainen [Tue, 31 Oct 2017 13:00:51 +0000 (15:00 +0200)] 
lib: Add o_stream_flush_parent()

7 years agolib: istream-base64-encoder - Fix getting size for empty stream
Timo Sirainen [Tue, 31 Oct 2017 15:42:15 +0000 (17:42 +0200)] 
lib: istream-base64-encoder - Fix getting size for empty stream

7 years agolib-master: Use skip_crl_check for ssl context
Aki Tuomi [Tue, 31 Oct 2017 10:16:41 +0000 (12:16 +0200)] 
lib-master: Use skip_crl_check for ssl context

7 years agolib-master: Load SSL module if wanted by service
Aki Tuomi [Mon, 16 Oct 2017 07:56:17 +0000 (10:56 +0300)] 
lib-master: Load SSL module if wanted by service

7 years agolib-master: Add master_service_ssl_settings_to_iostream_set
Aki Tuomi [Mon, 16 Oct 2017 07:47:36 +0000 (10:47 +0300)] 
lib-master: Add master_service_ssl_settings_to_iostream_set

7 years agolib-master: Support alternative cert in master_service_ssl_ctx_init
Aki Tuomi [Tue, 31 Oct 2017 08:10:39 +0000 (10:10 +0200)] 
lib-master: Support alternative cert in master_service_ssl_ctx_init

7 years agolib-ssl-iostream: Seed OpenSSL RNG earlier
Aki Tuomi [Tue, 24 Oct 2017 11:43:51 +0000 (14:43 +0300)] 
lib-ssl-iostream: Seed OpenSSL RNG earlier

Make sure we give the RNG a chance to
seed before we chroot.

7 years agolib-ssl-iostream: Expose ssl_module_load
Aki Tuomi [Thu, 7 Sep 2017 07:19:36 +0000 (10:19 +0300)] 
lib-ssl-iostream: Expose ssl_module_load

We need to load SSL module before we chroot in
login-common.

7 years agolib-ssl-iostream: Use named initializers
Aki Tuomi [Mon, 3 Oct 2016 09:04:26 +0000 (12:04 +0300)] 
lib-ssl-iostream: Use named initializers

7 years agolib-ssl-iostream: Remove input_handler flag
Aki Tuomi [Mon, 26 Sep 2016 10:55:17 +0000 (13:55 +0300)] 
lib-ssl-iostream: Remove input_handler flag

It is no longer needed after 87da941c

7 years agolib-ssl-iostream: Add get_compression accessor
Aki Tuomi [Mon, 26 Sep 2016 10:52:33 +0000 (13:52 +0300)] 
lib-ssl-iostream: Add get_compression accessor

This is needed by login-common

7 years agolib-ssl-iostream: Close ostream before istream
Aki Tuomi [Mon, 3 Oct 2016 10:39:35 +0000 (13:39 +0300)] 
lib-ssl-iostream: Close ostream before istream

If i_stream is autoclose, then o_stream
close will fail if done after i_stream
close.

7 years agolib-ssl-iostream: Allow skipping CRL check
Aki Tuomi [Mon, 3 Oct 2016 09:38:35 +0000 (12:38 +0300)] 
lib-ssl-iostream: Allow skipping CRL check

7 years agolib-ssl-iostream: Add alternate certificate support
Aki Tuomi [Mon, 30 Oct 2017 12:08:23 +0000 (14:08 +0200)] 
lib-ssl-iostream: Add alternate certificate support

7 years agoglobal: Splice cert into separate struct from iostream_ssl_settings
Aki Tuomi [Mon, 30 Oct 2017 12:06:36 +0000 (14:06 +0200)] 
global: Splice cert into separate struct from iostream_ssl_settings

7 years agolib-fs: test-fs-posix - Fix checking whether unlink_directory() failed
Timo Sirainen [Tue, 31 Oct 2017 15:01:26 +0000 (17:01 +0200)] 
lib-fs: test-fs-posix - Fix checking whether unlink_directory() failed

7 years agoman: Update manpage for mailbox delete command
Aki Tuomi [Mon, 30 Oct 2017 18:30:03 +0000 (20:30 +0200)] 
man: Update manpage for mailbox delete command

7 years agolib: Don't use NEEDS_LOCAL_CREDS undefined
Martti Rannanjärvi [Mon, 30 Oct 2017 17:29:02 +0000 (19:29 +0200)] 
lib: Don't use NEEDS_LOCAL_CREDS undefined

7 years agoglobal: Rename i_stream_is_eof() to i_stream_read_eof()
Timo Sirainen [Mon, 30 Oct 2017 14:06:39 +0000 (16:06 +0200)] 
global: Rename i_stream_is_eof() to i_stream_read_eof()

This describes its behavior a bit better.

7 years agoglobal: Avoid i_stream_is_eof() where it's not necessary
Timo Sirainen [Mon, 30 Oct 2017 14:11:43 +0000 (16:11 +0200)] 
global: Avoid i_stream_is_eof() where it's not necessary

7 years agolib: Improve i_stream_is_eof() comment
Timo Sirainen [Mon, 30 Oct 2017 14:06:21 +0000 (16:06 +0200)] 
lib: Improve i_stream_is_eof() comment

7 years agolib: Update struct istream comments
Timo Sirainen [Mon, 30 Oct 2017 14:01:31 +0000 (16:01 +0200)] 
lib: Update struct istream comments

7 years agolib-http: If istream read fails, preserve the istream's full error message
Timo Sirainen [Mon, 30 Oct 2017 14:00:13 +0000 (16:00 +0200)] 
lib-http: If istream read fails, preserve the istream's full error message

7 years agolib-http: test-http-client-errors - fix typo in error message
Timo Sirainen [Mon, 30 Oct 2017 13:59:46 +0000 (15:59 +0200)] 
lib-http: test-http-client-errors - fix typo in error message

7 years agolib-http: Detect istream errors correctly.
Timo Sirainen [Mon, 30 Oct 2017 13:58:43 +0000 (15:58 +0200)] 
lib-http: Detect istream errors correctly.

i_stream_is_eof() returns TRUE also when streams have an error, so all
errors were logged the same as a regular disconnection.

7 years agolib,lib-index: Use #ifdef with WORDS_BIGENDIAN
Martti Rannanjärvi [Mon, 30 Oct 2017 14:39:21 +0000 (16:39 +0200)] 
lib,lib-index: Use #ifdef with WORDS_BIGENDIAN

Some were missing from the last change.

7 years agoglobal: Remove explicit o_stream_flush() calls from ostream.close() methods
Timo Sirainen [Fri, 27 Oct 2017 23:57:37 +0000 (02:57 +0300)] 
global: Remove explicit o_stream_flush() calls from ostream.close() methods

It's now being done automatically.

7 years agolib: Automatically flush ostream when it's closed
Timo Sirainen [Fri, 27 Oct 2017 23:55:22 +0000 (02:55 +0300)] 
lib: Automatically flush ostream when it's closed

Also verify that it unexpectedly didn't get fully flushed.

7 years agomail-filter: ostream-ext-filter - Require o_stream_finish() to be called
Timo Sirainen [Fri, 27 Oct 2017 23:45:58 +0000 (02:45 +0300)] 
mail-filter: ostream-ext-filter - Require o_stream_finish() to be called

Similar to ostream-zlib.

7 years agolib-mail: ostream-dot - Require o_stream_finish() to write the trailer
Timo Sirainen [Fri, 27 Oct 2017 23:43:16 +0000 (02:43 +0300)] 
lib-mail: ostream-dot - Require o_stream_finish() to write the trailer

Similar to ostream-zlib.

7 years agolib: ostream-multiplex - Don't close parent streams at destroy
Timo Sirainen [Fri, 27 Oct 2017 23:35:58 +0000 (02:35 +0300)] 
lib: ostream-multiplex - Don't close parent streams at destroy

The close() method is already called as needed.

7 years agolib-dcrypt: ostream-dcrypt - Require o_stream_finish() to write the trailer
Timo Sirainen [Fri, 27 Oct 2017 23:21:48 +0000 (02:21 +0300)] 
lib-dcrypt: ostream-dcrypt - Require o_stream_finish() to write the trailer

Similar to ostream-zlib.

7 years agolib-compression: ostream-zlib - Require o_stream_finish() to write the trailer
Timo Sirainen [Fri, 27 Oct 2017 23:09:58 +0000 (02:09 +0300)] 
lib-compression: ostream-zlib - Require o_stream_finish() to write the trailer

It's now possible to call o_stream_flush() without the trailer getting
written.

It's also now required to call o_stream_finish() to write the trailer before
closing the ostream. This guarantees that the caller checks that the
trailer was successfully written. This isn't needed if the ostream already
failed before writing the trailer.

7 years agolib: Remove o_stream_nfinish()
Timo Sirainen [Fri, 27 Oct 2017 23:07:32 +0000 (02:07 +0300)] 
lib: Remove o_stream_nfinish()

7 years agoglobal: Replace o_stream_nfinish() with o_stream_flush()
Timo Sirainen [Fri, 27 Oct 2017 23:06:56 +0000 (02:06 +0300)] 
global: Replace o_stream_nfinish() with o_stream_flush()

7 years agoglobal: Replace o_stream_nfinish() with o_stream_finish() whenever possible
Timo Sirainen [Fri, 27 Oct 2017 22:55:12 +0000 (01:55 +0300)] 
global: Replace o_stream_nfinish() with o_stream_finish() whenever possible

7 years agolib: Add o_stream_finish()
Timo Sirainen [Fri, 27 Oct 2017 22:15:14 +0000 (01:15 +0300)] 
lib: Add o_stream_finish()

This marks the ostream as fully finished, with no further writes coming to
it. Otherwise it behaves like o_stream_flush().

The ostream.flush() methods are supposed to write their trailer (if the
ostream has one) when they see that ostream.finished is set. These will be
implemented by the following commits.

7 years agolib: o_stream_flush() - check for send overflows and reset error handling
Timo Sirainen [Fri, 27 Oct 2017 23:02:13 +0000 (02:02 +0300)] 
lib: o_stream_flush() - check for send overflows and reset error handling

This begins the removal of o_stream_nfinish().

7 years agolib: Remove o_stream_nflush()
Timo Sirainen [Fri, 27 Oct 2017 21:59:57 +0000 (00:59 +0300)] 
lib: Remove o_stream_nflush()

None of its previous callers were calling it correctly, so it's better to
remove it entirely to avoid more of such wrong calls.

7 years agoimap: Make sure long COPY commands send "* OK Hang in there" packets
Timo Sirainen [Fri, 27 Oct 2017 21:54:37 +0000 (00:54 +0300)] 
imap: Make sure long COPY commands send "* OK Hang in there" packets

o_stream_nflush() already flushed the writes to kernel, and Linux should
have sent them after 200ms delay, so this probably doesn't fix anything.
Using uncork+cork is a bit clearer way to indicate that the data really
is wanted to be sent now.

7 years agolib-imap: When sending "+ OK" to client, uncork ostream immediately
Timo Sirainen [Fri, 27 Oct 2017 21:48:01 +0000 (00:48 +0300)] 
lib-imap: When sending "+ OK" to client, uncork ostream immediately

This makes sure that it's sent to the client as soon as possible.

Also removed o_stream_nflush(), since uncorking does that already.
If there is no corking, the "+ OK" was already attempted to be sent
by the o_stream_nsend() call and a flush is unlikely to help.

7 years agoglobal: Remove unnecessary o_stream_nflush() calls
Timo Sirainen [Fri, 27 Oct 2017 20:31:32 +0000 (23:31 +0300)] 
global: Remove unnecessary o_stream_nflush() calls

The following o_stream_nfinish() or o_stream_uncork() calls it anyway.

7 years agolib: o_stream_uncork() - call o_stream_nflush() instead of o_stream_flush()
Timo Sirainen [Fri, 27 Oct 2017 20:31:56 +0000 (23:31 +0300)] 
lib: o_stream_uncork() - call o_stream_nflush() instead of o_stream_flush()

Otherwise flush errors may be unintentionally ignored. This change requires
that all the o_stream_uncork() callers must call o_stream_nfinish()
afterwards, unless the ostream is set to ignore errors.

7 years agolib: test-ostream-* - Call o_stream_nfinish() after uncorking
Timo Sirainen [Fri, 27 Oct 2017 21:13:28 +0000 (00:13 +0300)] 
lib: test-ostream-* - Call o_stream_nfinish() after uncorking

7 years agoconfigure: Add support for EXTRA_LDFLAGS
Aki Tuomi [Mon, 30 Oct 2017 09:56:32 +0000 (11:56 +0200)] 
configure: Add support for EXTRA_LDFLAGS

7 years agoimapc: Add imapc_features=fetch-empty-is-expunged
Timo Sirainen [Mon, 30 Oct 2017 09:19:17 +0000 (11:19 +0200)] 
imapc: Add imapc_features=fetch-empty-is-expunged

When FETCH returns an empty mail, the mail is assumed to be expunged.

7 years agoglobal: Use #ifdef instead of #if with WORDS_BIGENDIAN
Martti Rannanjärvi [Fri, 27 Oct 2017 08:03:07 +0000 (11:03 +0300)] 
global: Use #ifdef instead of #if with WORDS_BIGENDIAN

This is to not rely on undefined WORDS_BIGENDIAN being evaluated as 0.

7 years agolib/compat.h: Undefine WORDS_BIGENDIAN when it's defined as 0
Martti Rannanjärvi [Fri, 27 Oct 2017 08:08:36 +0000 (11:08 +0300)] 
lib/compat.h: Undefine WORDS_BIGENDIAN when it's defined as 0

7 years agom4: Use AC_C_BIGENDIAN instead of custom m4
Martti Rannanjärvi [Fri, 27 Oct 2017 08:02:25 +0000 (11:02 +0300)] 
m4: Use AC_C_BIGENDIAN instead of custom m4

7 years agolib-storage: Replace DBOX_GUID_BIN_LEN with GUID_128_SIZE
Martti Rannanjärvi [Tue, 24 Oct 2017 07:27:23 +0000 (10:27 +0300)] 
lib-storage: Replace DBOX_GUID_BIN_LEN with GUID_128_SIZE

DBOX_GUID_BIN_LEN define was removed in 0c909e, replace the use with
GUID_128_SIZE.

7 years agodirector: Don't use undefined DIRECTOR_CONNECTION_PING_TIMEOUT_MSECS
Martti Rannanjärvi [Tue, 24 Oct 2017 07:24:23 +0000 (10:24 +0300)] 
director: Don't use undefined DIRECTOR_CONNECTION_PING_TIMEOUT_MSECS

7 years agoauth: Don't use undefined SASL_VERSION_MAJOR
Martti Rannanjärvi [Tue, 24 Oct 2017 07:23:20 +0000 (10:23 +0300)] 
auth: Don't use undefined SASL_VERSION_MAJOR

7 years agoglobal: Rename client_connection_type to doveadm_connection_type
Aki Tuomi [Sat, 28 Oct 2017 12:21:29 +0000 (15:21 +0300)] 
global: Rename client_connection_type to doveadm_connection_type

7 years agodoveadm: Rename client_connection_type to doveadm_client_connection_type
Aki Tuomi [Fri, 27 Oct 2017 18:57:31 +0000 (21:57 +0300)] 
doveadm: Rename client_connection_type to doveadm_client_connection_type

Move it to doveadm.h to allow plugins use doveadm-cmd.h

7 years agodoveadm: Reorder includes
Aki Tuomi [Fri, 27 Oct 2017 19:06:28 +0000 (22:06 +0300)] 
doveadm: Reorder includes

This makes next commit possible

7 years agoquota: Improve error messages
Timo Sirainen [Mon, 23 Oct 2017 09:01:27 +0000 (12:01 +0300)] 
quota: Improve error messages

7 years agoquota-fs: Default to quota API v2 if _LINUX_QUOTA_VERSION is undefined.
Timo Sirainen [Wed, 18 Oct 2017 13:21:52 +0000 (16:21 +0300)] 
quota-fs: Default to quota API v2 if _LINUX_QUOTA_VERSION is undefined.

glibc v2.25 drops v1 support in sys/quota.h and doesn't define
_LINUX_QUOTA_VERSION.

7 years agodoveadm-server: http: Properly implemented error handling for requests.
Stephan Bosch [Tue, 17 Oct 2017 13:44:38 +0000 (15:44 +0200)] 
doveadm-server: http: Properly implemented error handling for requests.

7 years agodoveadm-server: http: Mark the HTTP request for connection closure right away.
Stephan Bosch [Tue, 17 Oct 2017 16:03:59 +0000 (18:03 +0200)] 
doveadm-server: http: Mark the HTTP request for connection closure right away.

This means that the connection is closed once the request finishes.
Before, each response did that individually.
Once connection reuse is implemented/needed this can now be turned off at one place.

7 years agodoveadm-server: http: Restructured JSON parsing to improve code clarity.
Stephan Bosch [Tue, 10 Oct 2017 22:57:08 +0000 (00:57 +0200)] 
doveadm-server: http: Restructured JSON parsing to improve code clarity.

Made state machine more explicit and easier to understand.
Also added more comments.

7 years agodoveadm-server: http: Wrapped long code lines.
Stephan Bosch [Mon, 16 Oct 2017 21:27:45 +0000 (23:27 +0200)] 
doveadm-server: http: Wrapped long code lines.

7 years agodoveadm-server: http: Joined JSON parsing and handling in one function.
Stephan Bosch [Tue, 10 Oct 2017 22:10:38 +0000 (00:10 +0200)] 
doveadm-server: http: Joined JSON parsing and handling in one function.

7 years agodoveadm-server: http: Split JSON handling into several sub-functions.
Stephan Bosch [Tue, 10 Oct 2017 21:51:57 +0000 (23:51 +0200)] 
doveadm-server: http: Split JSON handling into several sub-functions.

7 years agodoveadm-server: http: Split JSON parsing into several sub-functions.
Stephan Bosch [Sun, 8 Oct 2017 11:27:26 +0000 (13:27 +0200)] 
doveadm-server: http: Split JSON parsing into several sub-functions.

7 years agodoveadm-server: http: Changed request parse error into an assertion.
Stephan Bosch [Fri, 27 Oct 2017 07:36:39 +0000 (09:36 +0200)] 
doveadm-server: http: Changed request parse error into an assertion.

The condition can never occur when json-parser and the request parsing state machine are behaving correctly.
At that point only an object key can be returned; the client cannot cause it to return anything else.

7 years agodoveadm-server: http: Moved doveadm_http_server_command_execute().
Stephan Bosch [Tue, 10 Oct 2017 18:28:00 +0000 (20:28 +0200)] 
doveadm-server: http: Moved doveadm_http_server_command_execute().

7 years agodoveadm-server: http: Renamed parse state enum.
Stephan Bosch [Sat, 7 Oct 2017 23:19:34 +0000 (01:19 +0200)] 
doveadm-server: http: Renamed parse state enum.

7 years agodoveadm-server: http: Split off request handling in separate struct, so that the...
Stephan Bosch [Sat, 7 Oct 2017 20:33:26 +0000 (22:33 +0200)] 
doveadm-server: http: Split off request handling in separate struct, so that the connection can be reused.

7 years agodoveadm-server: http: Added structural comments.
Stephan Bosch [Sun, 8 Oct 2017 09:52:53 +0000 (11:52 +0200)] 
doveadm-server: http: Added structural comments.

7 years agodoveadm-server: http: Moved doveadm_http_server_request_destroy().
Stephan Bosch [Sun, 8 Oct 2017 09:44:40 +0000 (11:44 +0200)] 
doveadm-server: http: Moved doveadm_http_server_request_destroy().

7 years agodoveadm-server: http: Moved doveadm_http_server_send_response().
Stephan Bosch [Sat, 7 Oct 2017 17:11:04 +0000 (19:11 +0200)] 
doveadm-server: http: Moved doveadm_http_server_send_response().

7 years agodoveadm-server: http: Moved connection-related code to the bottom of the file.
Stephan Bosch [Sat, 7 Oct 2017 17:08:03 +0000 (19:08 +0200)] 
doveadm-server: http: Moved connection-related code to the bottom of the file.

7 years agodoveadm-server: http: Make http_server_set a local variable of doveadm_http_server_in...
Stephan Bosch [Sat, 7 Oct 2017 16:52:57 +0000 (18:52 +0200)] 
doveadm-server: http: Make http_server_set a local variable of doveadm_http_server_init().

7 years agodoveadm-server: http: Create the http_response once needed, not preemptively.
Stephan Bosch [Sat, 7 Oct 2017 16:47:53 +0000 (18:47 +0200)] 
doveadm-server: http: Create the http_response once needed, not preemptively.

7 years agodoveadm-server: http: Split authentication into multiple functions.
Stephan Bosch [Sat, 7 Oct 2017 16:31:44 +0000 (18:31 +0200)] 
doveadm-server: http: Split authentication into multiple functions.

7 years agodoveadm-server: http: Renamed conn->http_server_request to conn->http_request.
Stephan Bosch [Sat, 7 Oct 2017 15:37:41 +0000 (17:37 +0200)] 
doveadm-server: http: Renamed conn->http_server_request to conn->http_request.

7 years agodoveadm-server: http: Removed http_request field from struct client_connection_http.
Stephan Bosch [Sat, 7 Oct 2017 15:28:04 +0000 (17:28 +0200)] 
doveadm-server: http: Removed http_request field from struct client_connection_http.

Not useful to put it there.

7 years agodoveadm-server: http: Renamed conn->http_client to conn->http_conn.
Stephan Bosch [Sat, 7 Oct 2017 15:16:22 +0000 (17:16 +0200)] 
doveadm-server: http: Renamed conn->http_client to conn->http_conn.

7 years agodoveadm-server: Restructured client-connection code so that TCP and HTTP connection...
Stephan Bosch [Sat, 7 Oct 2017 11:39:44 +0000 (13:39 +0200)] 
doveadm-server: Restructured client-connection code so that TCP and HTTP connection types are properly separated.