We started with char * pointers, but used different types of pointers
over time. This lead to alignment warnings. In practice, I think this
should never cause any problems (at least there have been no reports
in the 7 or so years we do this), but it is not clean. The interface is
now cleaned up. We do this in a way that does not require modifications
to modules that just use string parameters. For those with message
parameters, have a look at e.g. mmutf8fix to see how easy the
required change is.
removed debug messages that were orignally added just for testing
during feature development
see also https://github.com/rsyslog/rsyslog/pull/652
Thanks to Peter Portante for alerting me on them.
In rainerscript.c there was a wayward debug statement emitting a es str,
where the es string was converted to a c-string before printing, and
then freeing the memory. It would seem doing that on the fast path is
unnecessary, so we moved it under an explicit Debug test.
Searching for other uses of es_str2cstr() calls in dbgprintf() calls
(lowercase), which would mean that the memory allocation always occurs
even if the debugging is not enabled, we found two in omprog and
mmexternal.
In the modules that we touched, we switched to use DBGPRINTF() were
possible and logical, to avoid processing any parameters on the fast
path.
This did not have any real bad effects, but caused unnecessary
processing, as empty replies were not properly detected. Otherwise,
the bug was not noticible from the user's PoV.