further preparations for 3.4.0alpha3
Revert "lib/ivykis: Point the submodule to github"

This reverts commit 5a0f89cc47e890e7975b3d1dfb35a4d02b668486.
configure: fixed bashism in systemdsystemunitdir support

Signed-off-by: Tamas Pal <folti@balabit.hu>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
afsql: Create proper indexes for Oracle DBs.

When creating an index for an Oracle DB, the field name was enclosed
in apostrophes, which made Oracle very unhappy: it did not associate
the index with the intended field.

With other databases, the field name is not quoted in the CREATE INDEX
statement, and for Oracle, it shouldn't be, either.

This patch corrects the mistake, and removes the apostrophes in the
Oracle case too.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
log_proto_buffered_server_apply_state: fixed a complete source-file-resend in case encoding is used

The size of the raw data can grow up to max_buffer_size and at reload time
raw_buffer_size was validated against init_buffer_size, which is clearly
wrong as the buffer can grow at runtime.

Signed-off-by: Juhasz Viktor <jviktor@balabit.hu>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
logproto: refactor fixed encoding lookup into a separate function

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
LogProto: fixed a bug in fixed-size-encoding detection

Due to a typo, fixed-size encodings were not properly recognized, causing
syslog-ng to use the slow-path in case encoding() was used on a source.

This change fixes that issue, and at the same time publishes the function
log_proto_get_char_size_for_fixed_encoding() so that its unit test can call
it directly.

Cc: <syslog-ng-stable@balabit.hu>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
LogProtoTextServer: fixed a possible memory leak in case encoding() was used

In case encoding was used on a source, its related data structures were
not properly freed as the destructor function wasn't properly registered.

Cc: <syslog-ng-stable@balabit.hu>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
LogProtoBufferedServer: fixed a SockAddr caching problem that shouldn't be user-visible

The log_proto_buffered_server_fetch() function improperly NULLed the
cached GSockAddr instance every time it attempted to read. However that
forthcoming read may return EAGAIN, which causes the sockaddr to remain
NULL.

In case an EOF is read the next time, log_proto_fetch() will return NULL as
the originating sockaddr for the partial message still in the buffer.

This bug shouldn't bite anyone as the cached sockaddr is only used for
udp() sources, but which in turn don't have partial messages nor EOFs.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
LogProtoFramedServer: change dynamic buffer allocation

Until now the buffer of LogProtoFramedServer class implementing
RFC5424 style framing was sized in accordance to the maximum frame length
processed by the class. More exactly it was sized as "max_frame_len + 10".

This could mean that if most of the messages are about the same size, that
the buffer is limited to hold one single message. This is certainly not
the best for performance, so be a bit more liberal when allocating this
buffer size, it is scaled to hold 16 messages, but at the same time limited
to 6*log_msg_size().

This is 48k buffer space for the default log_msg_size() value of 8k and
matches exactly with the buffer size used by LogProtoTextServer.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
LogProtoFramedServer: fixed an incorrect error message

This patch changes the generic I/O error message to reflect that it
actually can apply to the framed data as well as the header.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
LogProtoDGramServer: encoding is to be applied to individual frames

Instead of trying to make up missing characters in one frame from the next,
treat them individually, especially as they might come from a different
source.

The same change is applied to LogProtoRecordServer used to read binary
files.

Cc: <syslog-ng-stable@balabit.hu>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
apphook: explicitly deinit a number of subsystems at shutdown

To get away with a number of leaks in unit tests.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
tests: use proper version for configuration in msg_parse_lib

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
tests: added support for comparing fixed length strings to testutils

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
tests: cleaned up includes in testutils

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
tests: added support for assertions on internal messages

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
test_logproto: add new unit test to cover LogProto server implementations

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
reorganize unit tests

This patch reorganizes unit tests a bit:
  - a separate libtest is created to hold unit test specific helper code
  - the unit test for csvparser is moved to its module directory
  - configure.in & Makefile.am files updated to work

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>