refactored the method so that it consistent in all functions and easier
to follow. Most importantly, now an as simple as possible locking paradigm
of lock ... unlock within the function. Hopefully easier to understand
both for humans and static code analyzers.
this in almost all cases indicates a real problem that the user
should be made aware of
For a case where the missing error message caused confusion
see also https://github.com/rsyslog/rsyslog/issues/1867
When a message larger than supported by the UDP stack is to be sent,
EMSGSIZE is returned, but not specifically handled. That in turn
will lead to action suspension. However, this does not make sense
because messages over the UDP max message size simply cannot be sent.
This patch truncates the message in question and reports an error
message with the condition.
closes https://github.com/rsyslog/rsyslog/issues/1654
previous code could deadlock if internal messages were issued
inside queue processing code, which effectively limited
error-reporting capabilities. This change makes it possible
to call error messages from any part of the code at any time.
This comes at the price of slightly delayed message output.
We should provide a vehicle to set environment variables via the
config file. This is most importantly for things like HTTP_PROXY.
Currently, to do this system startup files need to be modified,
which is cumbersome and different from platform to platform.
closes https://github.com/rsyslog/rsyslog/issues/1209
As it seems, different C compilers have different rules/interpretations
on inline functions. The current code base did not properly obey all C99
rules. We fix this by converting some functions to macros and others to
include the necessary C99 plumbing. We also remove some inline attributes
for functions where this seems to be to agressive (aka "function to big").
This fixes build problems in some environments and is a general code
cleanup measure.
previously, a kill -9 during the .qi write could keep the file
in inconsistent state. Now, we first write a temp file, and
(automically) rename it to "the real thing". So if something happens
during writing the .qi, at least the old state still is consistent.
This is inspired by the way the pid file is handled sind v8.19.
If the file creation succeeds, but chown() failed, the file was
still writen, even if the user requested that this should be treated
as a failure case. This is corrected by this commit.
Alos, some refactoring was done to create better error messages.
Note that this is below the usual 10MiB default, but should cause
no issues (output threads already use 4MiB stack size, for example).
This also addresses issues introduced by micro-libc's which only
provide very limited stack space by default.
closes https://github.com/rsyslog/rsyslog/issues/996
as we now use libfastjson, we do no longer need to check for "new"
features, as these are always present in libfastjson (things
like json_object_object_get_ex()).
closes https://github.com/rsyslog/rsyslog/issues/935
If a to-be-monitored file was created after inotify was initialized
but before startup was completed, the first chunk of data from this
file could be duplicated. This should have happened very rarely in
practice, but caused occasional testbench failures.
closes https://github.com/rsyslog/rsyslog/issues/791
We drop the use of the RS_*_ext macro since it is only used in one
place, and this change allows us to only perform the json-c call under
the mutex, and not the strdup() as well. We add checks for NULL from
json_*_string and strdup().
This is possible due to a new API in liblognorm 1.1.2;
Note that the amount of error messages depends on the version of
liblognorm used. Consequently, liblognorm 1.1.2 is now required
to run mmnormalize.
This makes rsyslog abort if any error message occured during config
processing. Howerver, this is too strict, because some messages are
really just warnings (like queue sizes too low) and do not cause
an unclean config. Nevertheless, these warnings are logged as errors
currently. So a full review and cleanup of emitted error messages
is necessary.
see also https://github.com/rsyslog/rsyslog/issues/78