42 Commits

Author SHA1 Message Date
Rainer Gerhards
d0bd66241f tcp: log pre-truncated oversize frames
Why:

TCP inputs can detect oversized frames before the core submit path sees a raw message larger than maxMessageSize. That left oversizemsg.errorfile unwritten for truncated TCP input.

Impact:

Configured oversize error logs now receive a JSON record for imtcp and imptcp frames that are truncated before core submit.

Before/After:

Before, pre-truncated TCP frames only emitted the normal warning; after, they also honor oversizemsg.errorfile.

Technical Overview:

Add a per-session flag that marks the current TCP frame as oversized when imtcp or imptcp detects the condition before submit. When the truncated message object is created, write the configured oversize JSON record before handing it to the ratelimit/submit path. Reset the flag when the message is submitted or a new frame starts. Add an imptcp regression test for oversizemsg.input.mode=truncate with oversizemsg.errorfile.

Closes: https://github.com/rsyslog/rsyslog/issues/5228

With the help of AI-Agents: Codex
2026-05-18 11:55:58 +02:00
Rainer Gerhards
a6678f624f
Merge pull request #6713 from rgerhards/fix-ratelimit-caller-handling
ratelimit: keep TCP batch processing on drops
2026-04-13 17:53:33 +02:00
Rainer Gerhards
e0dc6d52a4 ratelimit: free dropped TCP messages on helper errors
Why
The previous change kept TCP batch processing alive on ratelimit helper
errors, but it left message ownership with the caller in those error
paths. Continuing without cleanup leaks the message object.

Impact
Unexpected ratelimit helper errors now drop and free the current message
before processing continues.

Before/After
Before, non-discard helper errors could leak `pMsg` in imptcp and the
generic TCP session path. After, both paths destroy the unqueued message
before returning success to the caller.

Technical Overview
`ratelimitAddMsg()` and `ratelimitAddMsgPerSource()` only take ownership
of a message when they enqueue or explicitly discard it internally.
When they return an unexpected error, ownership remains with the caller.
Add `msgDestruct(&pMsg)` in the non-discard error branch for `imptcp`
and `tcps_sess`, and update the debug text to reflect that the message is
being dropped before batch processing continues.
This preserves the non-fatal caller behavior while closing the memory
leak identified by gemini-code-assist and cubic.

With the help of AI-Agents: Codex
2026-04-13 08:10:39 +02:00
Rainer Gerhards
9aa45c684f ratelimit: keep TCP batch processing on drops
Why
TCP inputs treat rate limiting as a normal control path. Propagating
helper return codes into the submit path makes batch processing more
fragile than necessary and overstates submitted-message accounting.

Impact
TCP inputs now keep processing after ratelimit helper drops or internal
helper errors, while submit counters only advance for accepted messages.

Before/After
Before, callers ignored helper results for accounting and could be wired
to abort on helper returns. After, they treat drops and helper errors as
non-fatal and log them for diagnosis.

Technical Overview
Capture the return code from ratelimitAddMsg() and
ratelimitAddMsgPerSource() in the imptcp and generic TCP submit paths.
Only increment the submit counter when the helper accepts the message.
Treat RS_RET_DISCARDMSG as an expected outcome and continue processing.
For other helper errors, emit DBGPRINTF diagnostics and continue the
batch instead of returning failure to the caller.
This keeps ratelimit behavior aligned with normal message shedding while
preserving observability for unexpected helper problems.

With the help of AI-Agents: Codex
2026-04-12 19:22:21 +02:00
Rainer Gerhards
d0d84a824d runtime: cleanup zero-size alloc handling
Why
Guard obvious zero-size allocation edges and remove a couple of
stale or misleading notes in the imtcp/tcpsrv path so future
reviews see the intended behavior directly in code.

Impact
Empty key and lookup-table files now fail before zero-size
allocations; OpenSSL accepted sessions use per-session callback
context.

Before/After
Before, empty files could flow into malloc(0)-style paths and the
OpenSSL accept path stored listener-owned callback context.
After, those runtime paths fail early and accepted OpenSSL sessions
carry their own callback context.

Technical Overview
Reject empty key files in the libgcry and OpenSSL runtime helpers
before allocating buffers from sb.st_size.
Reject empty lookup-table files before allocating and parsing the
JSON payload.
Update accepted OpenSSL sessions to store pNew-owned callback state
in SSL ex-data instead of the listener object's pointers.
Remove a stale TODO in the imtcp octet-count parser because the
zero-count case already falls into the framing-error path.
Add a short comment that maxReads==0 is intentional and documented
behavior that disables starvation protection.

With the help of AI-Agents: Codex
2026-04-12 17:38:02 +02:00
Rainer Gerhards
ca8543a6b3
runtime: harden TCP framing size handling
Why
Prevent malformed or oversized runtime inputs from reaching unsafe
allocation and framing paths in the main TCP runtime components.

Impact
Rejects overflow-sized framing configurations and invalid internal
severity values with focused regression coverage.

Before/After
Before, several runtime framing paths could overflow size arithmetic;
after, they fail closed before allocation or copy.

Technical Overview
The outbound TCP client framing path now validates octet-stuffing and
octet-counting size arithmetic before building framed buffers.

TCP session construction now uses size_t-based allocation for the base
receive buffer and rejects regex framing configurations whose
maxMessageSize would overflow the doubled session buffers.

The listener setup adds the same regex framing guard early so invalid
configurations fail during setup instead of later in session creation.

Facility and severity decoding now NUL-terminates the symbolic lookup
buffer and uses checked strtol parsing for numeric values.

Two shell tests cover the regex framing overflow case and invalid long
internalmsg severity values, and distcheck includes both successfully.

With the help of AI-Agents: Codex
2026-04-09 19:27:09 +02:00
Aditi Prakash
075bf3006a core: Fix typos in comments
This improves code readability and maintainability by correcting
typos in comments. While non-functional, clear comments reduce
confusion for contributors and support long-term project quality.

Before: comments contained minor typos and inconsistencies.
After: comments use corrected spelling and clearer wording.

Impact: none (no functional or behavioral changes).

The patch updates comment text only, without modifying logic,
interfaces, or runtime behavior. No changes to queue semantics,
transactions, or module interactions are introduced.

This aligns with ongoing maintenance efforts to keep the codebase
clean and easier to understand for contributors and reviewers.

Fixes: https://github.com/rsyslog/rsyslog/issues/6023

AI-Agent: Copilot 2026-03
2026-03-16 23:40:43 -07:00
Rainer Gerhards
3ee31a8d05
ratelimit: add named policies; wire into imtcp/imptcp
Non-technical: centralize and reuse rate-limit definitions so admins
can apply consistent policies across listeners. This is part of an
ongoing series to improve rate limiting and its manageability.

Before: inputs set per-listener interval/burst ad hoc.
After: inputs can reference a named ratelimit() policy shared across
listeners; per-listener values remain as fallback.

Impact: New ratelimit() object and RateLimit.Name param for imtcp/imptcp.
If a policy file is configured but libyaml is unavailable, config fails.

Technical details:
- Add top-level ratelimit() Rainerscript object. Parsed in rsconf and
  stored in a central registry (hashtable + rwlock) on rsconf.
- New runtime API: ratelimitAddConfig(), ratelimitNewFromConfig(), plus
  cfgs init/destruct on rsconf lifecycle.
- imtcp/imptcp accept RateLimit.Name; when set, tcpsrv/imptcp build the
  ratelimiter from the named policy; otherwise legacy interval/burst is
  used. Thread-safety retained via ratelimitSetThreadSafe().
- tcpsrv gains ownership helpers for listener params and frees them on
  errors; imtcp explicitly transfers ownership and nulls the pointer.
- Optional libyaml: detected at configure; runtime parser loads simple
  key/value policy files (interval, burst, severity).
- Docs: new ratelimit object page; imtcp/imptcp parameter references and
  module docs updated; design-decisions note added for libyaml.
- Tests: add ratelimit_name.sh (guarded for imtcp+imptcp) to validate
  named policy application and observable throttling.

Refs: https://github.com/rsyslog/rsyslog/issues/6201
With the help of AI-Agents: Antigravity

imudp: add ratelimit.name support

This commit adds the `ratelimit.name` parameter to imudp, allowing listeners
to utilize the global rate limit registry (shared state).

Features:
- New `ratelimit.name` string parameter.
- Integration with `ratelimitNewFromConfig`.
- Strict mutual exclusivity: specifying `ratelimit.name` prohibits the use
  of legacy per-listener parameters (`ratelimit.burst`, `ratelimit.interval`).
  If a conflict occurs, an error is logged and the named rate limit takes precedence.
- Updated documentation.
- New regression test `tests/imudp_ratelimit_name.sh`.

With the help of AI Agent: Google Antigravity
2026-02-03 14:25:23 +01:00
Rainer Gerhards
3456e2f5f6
imtcp: add MultiLine and regex framing support
Non-technical: improves operator ergonomics and closes a feature gap
with imptcp. Enables regex-based start-of-frame detection and optional
multi-line message handling on TCP inputs.

Impact: New config params; defaults keep existing behavior unchanged.

Before: imtcp framed messages via octet-counting or LF delimiter only.
After: imtcp can treat lines not starting a new frame as continuations
(MultiLine) and can split frames on a regex start pattern.

Technical:
- Adds imtcp params: MultiLine (bool) and framing.delimiter.regex (string).
  Regex compilation happens in tcpsrv on listener creation; errors if
  regex is set without FEATURE_REGEXP.
- tcps_sess adds a regex-aware path that tracks current-line offset,
  runs the compiled regex on line starts, and uses a second buffer to
  handle split packets cleanly. On >2x max-line without a match, we
  submit and reset to avoid unbounded growth.
- Introduces input state eInMsgCheckMultiLine and LF lookahead to decide
  continuation vs new frame; when at buffer end, defers the decision to
  the next packet.
- Updates processDataRcvd signature to accept a movable cursor and
  buffer length for lookahead; DataRcvd passes these and advances the
  pointer accordingly.
- Wires regexp object usage in tcpsrv/tcps_sess init/exit; frees compiled
  patterns on listener teardown and error paths. Tests cover both new
  code paths (regex framing and multi-line).

Closes https://github.com/rsyslog/rsyslog/issues/5637
2026-01-30 17:02:57 +01:00
Rainer Gerhards
62bfaa152c
imtcp: Improve peer logging to include source ports (#6198)
* imtcp: include peer ports in runtime log messages

Ensure tcpsrv and session diagnostics report the sender's source port alongside the existing host/IP fields so administrators can pinpoint connections precisely. This updates imtcp connection notices, close/error paths, and framing warnings to use a consistent "host (ip:port)" style already present in TLS mismatch logs.

With the help of AI-Agent: Codex
2025-09-29 10:39:28 +02:00
Rainer Gerhards
79febe5fd0
* imtcp: warn on TLS handshakes received on plain listeners
Admins often report "gibberish" when a TLS-enabled sender connects to a
plain imtcp port. Making the mismatch explicit reduces operator confusion
and support churn, and points directly to remediation.

Impact: logs one explicit error per mismatched connection; no change to
parsing or transport on plain listeners.

Before/After: before, ClientHello bytes were ingested as binary with no
hint; after, imtcp detects a TLS ClientHello on ptcp and logs a clear
message with a troubleshooting URL.

Technically, we add a small per-session probe in tcps_sess_t and sample
the first 5 bytes of new sessions. If the record header matches a TLS
handshake (type 0x16, version 0x03.00–0x04, length 40–16384) and the
listener is plain TCP (streamDriver.mode=0), we emit a single error and
disable further probing for that session. The probe is called from
DataRcvd() and returns RS_RET_SERVER_NO_TLS when triggered; the session
is otherwise left untouched.

Runtime: introduce RS_RET_SERVER_NO_TLS (-2465) to tag the condition.
Docs: add imtcp troubleshooting section and a dedicated FAQ page.
Tests/tools: add test imtcp-tls-gibberish.sh and extend tcpflood with
-H to send only a ClientHello (OpenSSL and GnuTLS paths tolerate early
termination and non-blocking I/O for this mode).
2025-09-17 17:22:01 +02:00
Rainer Gerhards
c89113d531
core: add fromhost-port message property
Some deployments need to disambiguate multiple senders sharing an IP,
for example autossh or similar tunnel setups. Exposing the source port
improves observability and lets pipelines key on a stable tuple.

Impact: new property/JSON field; tcps_sess IF v4; out-of-tree modules
must rebuild.

Before: messages exposed fromhost and fromhost-ip only.
After:  messages also expose fromhost-port and jsonmesg includes it.

Introduce PROP_FROMHOST_PORT and wire it through msg.{h,c}. For TCP,
capture the remote port on accept, store it in tcps_sess, and attach it
to the msg on submit. For other inputs, resolveDNS derives the port from
the sockaddr when available; local inputs return an empty string. Add a
getter, duplication and destructor handling, and name<->ID mapping. Add
the field to jsonmesg output. Update docs, lexer keywords, and the
external plugin interface doc (property is modifiable). Bump
tcps_sessCURR_IF_VERSION to 4 and add SetHostPort() to the interface.
Include a focused test (fromhost-port.sh) that verifies the property.

Non-technical rationale: allow identification by (fromhost-ip,
fromhost-port) where IP alone is shared across systems (e.g., autossh).

With help from AI-Agents: ChatGPT
2025-09-09 14:29:39 +02:00
Rainer Gerhards
75c06fa333
tcpsrv: revert PR 5806 because it was ineffective
While at the time of merge I was confident it would fix a data race,
the root cause has now surfaced to be a simple state advancement
(single-threaded) bug. See commit c5fd73499 for details. As such
I revert this patch. it caused no harm, but complicates code, adds
a bit of computation and is no longer needed.

I cannot 100% outrule it might have addressed some edge cases.
I know an environment where we can verify this within the next
month or so. If, unexpectedly, this shows regressions, we can
re-enable the patch. But I am 99.99% sure it is not needed.

see also: https://github.com/rsyslog/rsyslog/pull/5806
see also: https://github.com/rsyslog/rsyslog/pull/5993
2025-08-22 11:20:13 +02:00
google-labs-jules[bot]
86ff8046e0
Fix race condition in imtcp when closing sessions
This commit fixes a race condition that could occur when two threads tried to close the same TCP session simultaneously. This could lead to an "epoll_ctl failed: Bad file descriptor" error message.

The fix introduces an atomic flag `being_closed` to the `tcps_sess_t` struct. This flag is used to ensure that the session-closing logic is executed only once per session.
2025-07-31 12:55:42 +02:00
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
Rainer Gerhards
7225999b77 refactor: modernize macro definitions to support formatting and clarity
This commit performs a broad modernization of widely used rsyslog
macros to align with modern C practices and support automated
formatting tools like clang-format. The changes focus on improving
syntactic regularity, readability, and tooling compatibility — without
altering behavior.

Macros refactored in this commit now follow a consistent,
statement-like form with explicit trailing semicolons. Where
applicable, macro blocks that define module interfaces (`queryEtryPt`)
have been updated to use simple `if` statements instead of `else if`
chains. While this slightly increases evaluation time, the affected
functions are only called once per module during load time to register
supported interfaces — making the performance cost irrelevant in
practice.

These improvements serve multiple purposes:
- Enable reliable clang-format usage without mangling macro logic
- Simplify reasoning about macro-expanded code for human readers
- Reduce style drift and merge conflicts
- Facilitate development for contributors using assistive tools
- Support future formatting pipelines using:
  1. `clang-format`
  2. a post-fixup normalization script

Refactored macros:
- MODULE_TYPE_NOKEEP
- MODULE_TYPE_KEEP
- MODULE_TYPE_INPUT
- MODULE_TYPE_OUTPUT
- MODULE_TYPE_FUNCTION
- MODULE_TYPE_PARSER
- MODULE_TYPE_LIB
- DEF_IMOD_STATIC_DATA
- DEF_OMOD_STATIC_DATA
- DEF_PMOD_STATIC_DATA
- DEF_FMOD_STATIC_DATA
- DEFobjStaticHelpers
- SIMP_PROP(...)

And all `queryEtryPt()` dispatch macros:
- CODEqueryEtryPt_STD_MOD_QUERIES
- CODEqueryEtryPt_STD_OMOD_QUERIES
- CODEqueryEtryPt_STD_OMODTX_QUERIES
- CODEqueryEtryPt_STD_OMOD8_QUERIES
- CODEqueryEtryPt_TXIF_OMOD_QUERIES
- CODEqueryEtryPt_IsCompatibleWithFeature_IF_OMOD_QUERIES
- CODEqueryEtryPt_STD_IMOD_QUERIES
- CODEqueryEtryPt_STD_CONF2_QUERIES
- CODEqueryEtryPt_STD_CONF2_setModCnf_QUERIES
- CODEqueryEtryPt_STD_CONF2_OMOD_QUERIES
- CODEqueryEtryPt_STD_CONF2_IMOD_QUERIES
- CODEqueryEtryPt_STD_CONF2_PREPRIVDROP_QUERIES
- CODEqueryEtryPt_STD_CONF2_CNFNAME_QUERIES
- CODEqueryEtryPt_STD_PMOD_QUERIES
- CODEqueryEtryPt_STD_PMOD2_QUERIES
- CODEqueryEtryPt_STD_FMOD_QUERIES
- CODEqueryEtryPt_STD_SMOD_QUERIES
- CODEqueryEtryPt_doHUPWrkr
- CODEqueryEtryPt_doHUP

This general modernization reduces macro misuse, improves DX, and
lays the foundation for a robust, automated style normalization
system.

See also: https://github.com/rsyslog/rsyslog/issues/5747
2025-07-15 08:25:58 +02:00
Rainer Gerhards
ad1fd213a7
imtcp: major multithreading and performance improvements
This commit significantly enhances imtcp by introducing a fully
functional worker thread pool, enabling true multi-threaded
processing for better scalability under high loads. This is
particularly beneficial when using TLS connections.

Notable changes:
- Implemented a complete worker pool for imtcp.
- Introduced the `workerthreads` config parameter for tuning
  concurrency.
- Improved epoll efficiency by enabling edge-triggered mode.
- Added starvation handling via `starvationProtection.maxReads`.
- Refactored session accept logic and optimized network object
  handling.
- Removed an obsolete network driver layer for event notification.
- Fixed multiple issues related to message timing, EPOLLERR
  handling, and tests.
- Improved performance in poll() mode by reducing redundant
  allocations.
- Introduced new CI tests for imtcp without epoll.
- Allowed disabling imtcp tests via a new configure switch.
- Added new impstats counters for worker thread pool statistics.

Details:
- The worker pool replaces an outdated experimental
  implementation.
- If `workerthreads=1`, no worker pool is created to minimize
  context switches.
- Moves worker pool variables inside `tcpsrv` instance to
  prevent conflicts.
- Extracts session `accept()` logic into a dedicated function
  for clarity.
- Fixes message ordering inconsistencies in multi-threaded
  scenarios.
- Properly handles `EPOLLERR` notifications to improve error
  resilience.
- Optimizes poll() mode by avoiding unnecessary reallocation
  of file descriptors.
- Replaces the old network driver layer for event notification
  with a streamlined solution.
  - Now uses **conditional compilation** to select the best
    method (epoll or poll) at build time.
  - This significantly reduces code complexity, improves
    maintainability, and boosts performance.
- The previous "thread pool" was a rough experiment that did
  not perform significantly better than single-threaded mode.
  - The **new implementation** allows multiple worker threads
    on platforms with `epoll`.
  - On non-epoll systems, an optimized **poll() based
    single-threaded approach** is used, which is expected to
    perform better than the old "thread pool."
- Adds `pthread_setname_np` only when available to improve
  portability.
- Fixes test cases that assumed strict message timing, which
  was unreliable.
- Reduces test parallelism for TSAN CI runs to prevent
  resource exhaustion.
- Moves a test case to `imdiag` to ensure stable execution.
- Provides a new CI environment to verify `imtcp` behavior
  without epoll.
- Introduces `--enable-imtcp-tests` configure switch for test
  flexibility.
- Improves debug logging and adds better error handling for
  worker pool startup.

New configuration parameters:
- `workerthreads`: Defines the number of worker threads for
  imtcp. If set to 1, no worker pool is created.
- `starvationProtection.maxReads`: Defines the maximum number
  of consecutive reads a worker can perform before being
  interrupted to allow other sessions to be processed.

New impstats counters (emitted only when `workerthreads > 1`):
- `runs`: Number of times the worker thread has been invoked.
- `read`: Number of read calls performed by the worker.
  For TLS, this includes read/write calls.
- `accept`: Number of `accept()` calls handled by the worker.
- `starvation_protect`: Number of times a socket was sent
  back to the queue due to reaching the maximum number of
  consecutive requests, ensuring fair scheduling of sessions.

These changes significantly enhance rsyslog’s TCP handling
performance and stability, particularly in high-volume
environments.

Closes #5529, #5532, #5578, #5580.
2025-03-01 14:01:20 +01:00
Rainer Gerhards
d1a98b8260
tcpsrv/imtcp: slight performance improvements
This patch slightly improves performance for tcpsrv-based servers.
This affects imtcp and imgssapi as well as some helpers.

No other functional change is included in this patch.
2022-05-18 10:08:47 +02:00
Rainer Gerhards
89955b0bcb net bugfix: potential buffer overrun 2022-05-03 13:22:21 +02:00
alakatos
321fc76f0f Move rsyslog global parameters to rsconf_t struct 2022-01-13 12:43:21 +01:00
Rainer Gerhards
f83306fe2a
imtcp: add support for permittedPeers setting at input() level
The permittedPeers settig was actually forgotten during the refactoring
of TLS input() level settings. This functionality is now added.

closes: https://github.com/rsyslog/rsyslog/issues/4706
2021-10-25 11:05:20 +02:00
Rainer Gerhards
3470728d44
further refactoring of tcpsrv parameter passing
Some further stream-lining and cleanup of paramter passing. This
levels ground for more substantial changes to the imtcp/tcpsrv
interaction.

see also https://github.com/rsyslog/rsyslog/issues/3727#issuecomment-525705318
2021-04-26 09:05:01 +02:00
Rainer Gerhards
926e207575
phase 1: consolidate current imtcp input params in a single structure
see also https://github.com/rsyslog/rsyslog/issues/3727
2021-04-22 08:44:55 +02:00
82621cdd14 imtcp: fix octet framing/stuffing problem with discardTruncatedMsg on
When "discardTruncatedMsg" is enabled in imtcp, messages were incorrectly
skipped if the last character before the truncation was the LFdelimiter.

Add two tests for octet stuffing and framing.

closes: https://github.com/rsyslog/rsyslog/issues/4281
2020-05-15 09:56:44 +02:00
Rainer Gerhards
ea219194b6
imtcp bugfix: oversize message truncation causes log to be garbled
The actual problem is in the tcpserver component. However, the prime user
is imtcp and so users will likely experience this as imtcp problem.

When a too-long message is truncated, the byte after the truncation
position becomes the first byte of the next message. This will garble
the next messages and in almost all cases render it is syslog-incompliant.

The same problem does NOT occur when the message is split.

This commit fixes the issue. It also includes a testbench fix.
Unfortunately the test for exactly this feature was not properly
crafted and so could not detect the problem.

closes https://github.com/rsyslog/rsyslog/issues/3580
2019-04-29 18:39:44 +02:00
Rainer Gerhards
9bece39dc6
SQUASH
debug cleanup: remove some old, no longer used macros
2018-10-30 12:46:04 +01:00
Rainer Gerhards
223c03e536
cleanup: remove commented-out code
thanks to lgtm.com for the ability to detect commented out code!
2018-10-27 19:04:30 +02:00
PascalWithopf
19133327cc correct codestyle in rsyslog 2018-07-31 09:44:27 +02:00
Jan Gerhards
aefa89d3c0 tcps_sess: use new ermsg interface
see also https://github.com/rsyslog/rsyslog/issues/1684
2018-01-15 10:55:34 +01:00
Rainer Gerhards
8cb0a95a38 code style: fix too-long lines 2017-12-23 18:25:37 +01:00
PascalWithopf
a10744ce2a imtcp: include name of action in error msg 2017-08-21 16:02:12 +02:00
PascalWithopf
5132bc32d2 imtcp: framing/size errmsgs contain remote peer
closes https://github.com/rsyslog/rsyslog/issues/1676
2017-07-19 11:58:40 +02:00
Rainer Gerhards
5e27f96554 Merge pull request #1527 from PascalWithopf/imtcpMaxFrame
imtcp: add parameter maxFrameSize
2017-04-26 12:21:01 +02:00
PascalWithopf
08c265d24d imtcp: add new parameter discardTruncatedMsg 2017-04-25 08:54:00 +02:00
PascalWithopf
01feb44bf1 imtcp: add parameter maxFrameSize 2017-04-20 12:58:57 +02:00
purnima
d45daa2af0 Rebase,redefine msgDestruct() as smsg_t is used 2016-11-22 14:24:25 +05:30
Tomas Heinrich
60fab9be00 Fix processing of partial messages over TCP
Commit b0e8ce6c added a new variable to track processing of a single
message split into multiple packets. Several bits of code weren't
ported to the new variable and could cause mishandling.
Messages not terminated by a NL were discarded upon connection
termination.
2016-03-05 23:39:22 +01:00
Rainer Gerhards
844ca49cf5 add sender tracking/stats for imtcp
as well as other inputs that utilize the tcps_sess.c subsystem
2016-02-01 15:50:04 +01:00
Rainer Gerhards
a5b944a2dc bugfix: invalid check for user-configured timezone
The default was never used.
2016-01-27 09:25:36 +01:00
Rainer Gerhards
e8c8e96e27 refactor time-obtaining functions so that the can obtain time in UTC
This works where the time is picked up locally.
2016-01-11 18:52:42 +01:00
Peter Portante
2470f0f72b Remove use of sizeof(char) and sizeof(uchar)
Remove the use sizeof(char) or sizeof(uchar) in calculations for memory
allocation or string length.  There are no known platforms for which
sizeof(char) or sizeof(uchar) is not 1, and c99 has defined sizeof(char)
to be 1 (section 6.5.3.4 of c99).
2015-12-16 02:18:45 +00:00
Rainer Gerhards
4725aa27e7 build system: move some files to subdir
This seems to be necessary to make "make distcheck" work.
2015-05-22 10:20:29 +02:00