36 Commits

Author SHA1 Message Date
Rainer Gerhards
b326c76f45 style: normalize C source formatting via clang-format (PoC)
This commit applies the new canonical formatting style using `clang-format` with custom settings (notably 4-space indentation), as part of our shift toward automated formatting normalization.

⚠️ No functional changes are included — only whitespace and layout modifications as produced by `clang-format`.

This change is part of the formatting modernization strategy discussed in:
https://github.com/rsyslog/rsyslog/issues/5747

Key context:
- Formatting is now treated as a disposable view, normalized via tooling.
- The `.clang-format` file defines the canonical style.
- A fixup script (`devtools/format-code.sh`) handles remaining edge cases.
- Formatting commits are added to `.git-blame-ignore-revs` to reduce noise.
- Developers remain free to format code however they prefer locally.
2025-07-16 13:56:21 +02:00
Philippe Duveau
9ad7324dfa AIX_port: second phase 2019-02-14 14:36:05 +01:00
PascalWithopf
19133327cc correct codestyle in rsyslog 2018-07-31 09:44:27 +02:00
purnima
d45daa2af0 Rebase,redefine msgDestruct() as smsg_t is used 2016-11-22 14:24:25 +05:30
Rainer Gerhards
51c03c66e0 make inline functions C99-compliant
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.
2016-09-05 16:47:14 +02:00
Rainer Gerhards
7c52a118c9 fix missing includes causing build issues
I wonder why this did not come up earlier...
2016-08-22 18:17:40 +02:00
Rainer Gerhards
09e4b4a7a6 remove over-agressive "inline" attributes 2016-06-03 15:52:20 +02:00
Rainer Gerhards
070d987a45 fix compiler warnings 2016-06-01 09:49:46 +02:00
Rainer Gerhards
6bd98320a4 another round of const qualifiers 2013-12-03 14:24:30 +01:00
Rainer Gerhards
bb2c29c09b remove no longer needed code 2013-12-03 13:57:41 +01:00
Rainer Gerhards
c786c8354d remove no longer used data member 2013-11-05 18:31:40 +01:00
Rainer Gerhards
1142083565 refactor: move pbShutdownImmediate to wti_t 2013-11-05 08:59:42 +01:00
Rainer Gerhards
774f7b7986 refactor: remove no longer needed elements from batch_t 2013-11-04 18:53:13 +01:00
Rainer Gerhards
9bbd09b1d3 cleanup: multiple rulesets inside a single batch are now OK
They don't require special handling any longer, so do no longer
care about them.
2013-11-04 18:33:31 +01:00
Rainer Gerhards
25b223c0dc more cleanup 2013-11-04 18:31:00 +01:00
Rainer Gerhards
094ae94c86 remove no longer needed vars from batch structure 2013-11-03 10:43:44 +01:00
Rainer Gerhards
d200ef2d8b temporarily remove bExecWhenPrevWasSuspended handling
also add comments on howto re-implement it inside the script engine
(but we do not do this right now as we would like to do this together
when we touch the script engine -- for now focussing on action
handling).
2013-11-02 17:43:24 +01:00
Rainer Gerhards
bf11ace45a refactor: move action state to wti (as we are now on a per-thread basis) 2013-11-01 17:22:32 +01:00
Rainer Gerhards
b69da427eb fix memory leak (regression from batch optimization work - unreleased) 2013-01-18 16:17:40 +01:00
Rainer Gerhards
9273b4bb4d optimize memory layout for much better cache hits
Moave element status out of batch_obj_t because we
get a *much* better cache hit ratio this way.
Note that this is really a HUGE saving, even if it
doesn't look so (both profiler data as well as
practical tests indicate that!).
2013-01-15 15:01:16 +01:00
Rainer Gerhards
62b5ae05d6 optimize: use fixed size (8 bits) instead of enum
looks like GCC, even if optimizing, uses 32 bits - at least this
is suggested by the profiler results (both in terms of runtime and
cache misses).
2013-01-15 10:11:38 +01:00
Rainer Gerhards
c55e0a5a06 queue: change generic msg ptr (pUsr) to be of msg_t type 2012-11-03 12:32:50 +01:00
Rainer Gerhards
c030585a63 fix invalid state handling during action execution
could lead to execution of not-to-be-executed action. very recent regression.
2012-09-25 15:35:08 +02:00
Rainer Gerhards
99f342e866 new ruleengine: fixed action handling in regard to filters
This was not yet adapted to the new "active" structure.
2012-09-12 11:10:48 +02:00
Rainer Gerhards
1ef709cc97 bugfix: fixed a memory leak and potential abort condition
this could happen if multiple rulesets were used and some output batches
contained messages belonging to more than one ruleset.
fixes: http://bugzilla.adiscon.com/show_bug.cgi?id=226
fixes: http://bugzilla.adiscon.com/show_bug.cgi?id=218
2011-02-25 14:14:17 +01:00
Rainer Gerhards
2181515805 bug fixes in action processing
- bugfix: action processor released mememory too early, resulting in
  potential issue in retry cases (but very unlikely due to another
  bug, which I also fixed -- only after the fix this problem here
  became actually visible).
- bugfix: batches which had actions in error were not properly retried in
  all cases
2010-12-17 10:43:55 +01:00
Rainer Gerhards
6e093aa326 made hardcoded max string number persistent
see commit for reasoning
2010-06-24 14:05:00 +02:00
Rainer Gerhards
31fae7b93d bugfix: "$ActionExecOnlyWhenPreviousIsSuspended on" was broken
Note that, as it looks, the directive was already broken in previous v5 versions.
So while I solved what looked like a (intentional) regression from the
performance tuning, I actually solved a previous regression as well ;)

I have also added new test cases to the testbench in order to capture such
problems in the future. This version does now look pretty good in shape.
2010-06-24 12:13:48 +02:00
Rainer Gerhards
802f6d8a8f milestone(BUGGY): batch now pushed down to action
at least in important cases (not for non-direct action queues and some
other minor things). This version is definitely buggy, but may be tried
with success on a non-production system. I will continue to work on the
correctness, but needed to commit now to get a baseline.
2010-06-15 14:02:34 +02:00
Rainer Gerhards
fe8d317c1b milestone commit(BUGGY): batch is now handed down to rule processing
Now, the full batch is passed down to the rule, which then enqueues
the elements as single messages. Note that this code has some known
defects and needs more changes until it is correct again. This is
primarily a commit to be able to return to a known-(somewhat)-good
state.
2010-06-10 14:36:49 +02:00
Rainer Gerhards
74135da959 some cleanup
as well as some work in preparation of storing doAction params inside
the batch
2010-06-10 12:24:22 +02:00
Rainer Gerhards
da53802c96 implemented solution for cancel at shutdown/unprocessed entries
We do now enqueue those objects that are left unprocessed. This enables
us to delete the full batch, what is exactly what we need to do.
2009-10-26 12:21:07 +01:00
Rainer Gerhards
0cf8e88a34 solved the intended-discard-during-dequeue issue 2009-05-19 18:58:33 +02:00
Rainer Gerhards
93f873277b t-delete list implemented, queue store drivers updated...
... on the way to the ultra-reliable queue modes (redesign doc). This
version does not really work, but is a good commit point. Next comes
queue size calculation. DA mode does not yet work.
2009-05-18 17:28:34 +02:00
Rainer Gerhards
e2b2298689 action batch processing implemented
... passed initial tests, but of course more are needed
2009-05-12 17:57:04 +02:00
Rainer Gerhards
bb79e96dc3 moving to a cleaner implementation of batches
... now that we know what we need from a theoretical POV.
2009-05-12 15:27:40 +02:00