John Fawcett [Wed, 24 Apr 2019 07:37:55 +0000 (10:37 +0300)]
fts-solr: Add soft_commit setting
soft_commit=yes|no: send softCommit to the solr server, default yes is backwards compatible behaviour
If setting to no autoSoftCommit on solr should be set to something reasonable (e.g. 60 seconds)
in file solrconfig.xml
Stephan Bosch [Thu, 25 Apr 2019 07:51:32 +0000 (09:51 +0200)]
lib-smtp: smtp-server-cmd-auth - Fix AUTH response error handling so that it stops reading more input.
Otherwise, it may try to read more data from the stream as the next AUTH
response, which causes an assert crash in the command parser later on. Even when
the parser finds no input from the stream, it will advance its state
towards AUTH response parsing, which is a problem when the next command is
subsequently being parsed.
Stephan Bosch [Wed, 6 Feb 2019 21:34:32 +0000 (22:34 +0100)]
lib-smtp: smtp-client - Fix sending of duplicate QUIT command.
The command name comparison function was broken after the command was sent. Made
the function robust against addition/removal of CRLF to the command line.
Stephan Bosch [Sun, 6 Jan 2019 15:22:02 +0000 (16:22 +0100)]
lib-smtp: client: Fix infinite loop in XCLIENT command interaction with server.
The state regarding the fact that the XCLIENT command was already sent was not
recorded. So, after the HELO handshake, the client would send a new XCLIENT
command.
Stephan Bosch [Wed, 20 Feb 2019 21:19:03 +0000 (22:19 +0100)]
lib-http: http-client-connection - Create function for obtaining client settings reliably.
This fixes and prevents segfaults occurring when settings are needed while the
connection is detached. In that case, the shared client context settings need
to be used rather than the client settings. Before, the attachment of a peer was
assumed for obtaining the settings when it actually could be absent in rare
cases, causing a NULL dereference.
Stephan Bosch [Sun, 9 Dec 2018 20:14:29 +0000 (21:14 +0100)]
lib-oauth2: Fix assert panic occurring while skipping ignored object and array fields.
Fixed by using json_parse_skip(), rather than json_parse_skip_next(). The latter
is not suitable for skipping a value that is already partially parsed by
json_parse_next().
Stephan Bosch [Sun, 9 Dec 2018 20:08:53 +0000 (21:08 +0100)]
lib-oauth2: Fix asynchronous parsing of JSON response payload.
The problem was caused by the fact that req->field_name was reset in the
beginning of oauth2_parse_json(), which is continuously called when more payload
can be read from the input stream. This leads to corruption of the parser state
machine each time parsing is continued.
To fix this issue, the field_name is now reset only when the parsing commences.
Stephan Bosch [Sun, 9 Dec 2018 19:27:10 +0000 (20:27 +0100)]
lib: json-parser: Add unit test on skipping various object member fields.
This both tests skipping fields based on their member key and based on their
value types; i.e., after calling json_parse_next() for the object member value.
Stephan Bosch [Sun, 9 Dec 2018 19:24:28 +0000 (20:24 +0100)]
lib: json-parser: Add support for skipping a value that is already partially parsed.
Adds json_parse_skip(), which skips the remainder of the value parsed earlier by
json_parse_next(). This is needed when values need to be skipped by their value
type rather than their object member key.
Aki Tuomi [Wed, 27 Feb 2019 13:25:06 +0000 (15:25 +0200)]
lib-storage: pop3c - Copy SSL settings correctly
When attempting to use pop3c with immediate SSL, it would
crash due to invalid memory access during connection setup.
Also the SSL mode is not copied so SSL handshake is not attempted
at later stage.
Aki Tuomi [Mon, 25 Feb 2019 15:44:09 +0000 (17:44 +0200)]
lib-ssl-iostream: Call ssl_iostream_check_cert_validity as default
Unless callback is specified, call ssl_iostream_check_cert_validity
instead of ssl_iostream_cert_match_name to make sure we perform
same checks consistently.
Stephan Bosch [Thu, 7 Feb 2019 01:37:27 +0000 (02:37 +0100)]
lib-smtp: smtp-client-command - Avoid calling the callback for the DATA command during submission.
This causes a race condition in which the command object is already freed when
it is returned from smtp_client_command_data_submit(). This scenario occurs when
reading data for the first BDAT command fails.
Stephan Bosch [Sun, 9 Dec 2018 11:13:59 +0000 (12:13 +0100)]
lib-smtp: command: Move main loop from sub-function to smtp_client_command_send_more() itself.
This reduces code indent in smtp_client_command_do_send_more() (the
sub-function) and it turns the inifite for loop into a nice conditional
while loop.
Stephan Bosch [Sun, 11 Nov 2018 22:32:15 +0000 (23:32 +0100)]
lib-smtp: test-smtp-client-errors: Test early DATA command success and error replies.
Early success for the DATA command is treated as a protocol error, while early
failure is allowed. Both situations are tested in a new scenario for the
test-smtp-client-errors unit test.
Stephan Bosch [Sun, 11 Nov 2018 19:30:25 +0000 (20:30 +0100)]
lib-smtp: test-smtp-client-errors: Add test scenario for premature success replies.
Such replies are sent immediately along with the reply of the previous command.
So, the reply is sent before the corresponding command is even submitted. This
tests whether the client handles this erroneous situation correctly.
Stephan Bosch [Wed, 15 Aug 2018 16:29:11 +0000 (18:29 +0200)]
lib-smtp: client: Allow receiving replies before command data stream is sent completely.
This avoids unnecessary problems with servers that reply somewhat early to DATA
and BDAT commands. For one, early failure replies are now handled properly.
Also, race conditions at the client between sending the closing CRLF.CRLF and
receiving the DATA reply are no longer causing problems.
Stephan Bosch [Sat, 8 Sep 2018 18:54:54 +0000 (20:54 +0200)]
lib-smtp: client: BDAT command: Make sure the message contains CRLF consistently.
Before, only messages sent using DATA command guaranteed consistent CRLF,
because these are sent using o_stream_dot(), which does that internally. For the
BDAT command, the message was sent as-is, which is not always accepted by MTAs.
Stephan Bosch [Fri, 26 Oct 2018 10:15:45 +0000 (12:15 +0200)]
lib-smtp: client: BDAT command: Ensure data stream max buffer size is appropriate when stream size is unknown.
When stream size is unknown, the chunk size are determined by what can be
buffered in the data input stream immediately. If it's maximum buffer size is
(much) smaller than the maximum chunk size, the maximum chunk size is never
achieved.
Stephan Bosch [Fri, 26 Oct 2018 14:17:06 +0000 (16:17 +0200)]
lib-smtp: server: Fix forwarding a multi-line reply.
A multi-line reply had the '-' on the first line stripped upon sending, which
makes clients see two separate responses rather than just one. This was caused
by the fact that forwarded replies had the last_line field not set properly,
in which case the '-' was substituted on the first line, rather than the last.
The fix makes a forwarded reply indistinguishable from a normally created reply
by also allowing for amending the reply with additional lines using
smtp_server_reply_add_text().