127 Commits

Author SHA1 Message Date
Nate Brown
1b0c09f1da Unlink option with tests and cleanup 2016-03-09 17:21:06 -08:00
Nate Brown
d50f9af79e Fix port usage when not provided 2016-03-04 16:30:23 -08:00
Nate Brown
4a51e63f22 Use local hostname 2016-03-04 16:00:09 -08:00
Nate Brown
5f604fc5ee Try to remove unix socket on close 2016-03-04 13:24:44 -08:00
Nate Brown
d95ef23f58 Cleanup listen 2016-03-04 13:04:54 -08:00
Nate Brown
a9ee86844d Starting work for sock_stream support with unix sockets 2016-03-04 11:44:43 -08:00
Rainer Gerhards
af1a845a96 add "senders.keeptrack" global parameters
permits to turn on/off (default) sender tracking and stats
2016-02-01 15:49:17 +01:00
Rainer Gerhards
861059467b implement sender-specific statistics
see also https://github.com/rsyslog/rsyslog/issues/751

Note: this is only the impstats part of the feature request,
and only done for imptcp.
2016-02-01 12:42:51 +01:00
Rainer Gerhards
40d030d2c7 Merge branch 'master' of https://github.com/janmejay/rsyslog into master-merge-imptcp
Conflicts:
	plugins/imptcp/imptcp.c
	tests/Makefile.am
	tests/tcpflood.c
2016-01-28 11:20:04 +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
377e3238f7 imptcp: work around false positive from clang static analyzer 2015-12-04 14:45:42 +01:00
Janmejay Singh
3e9320b38d fixed an old race-condition in imptcp (other polling-listeners may have it too, we need a wider check), which allowed an io-event to be returned for a connection which was not yet added to connection-list, which caused close to race with add, and caused a illegal-memory-access in connection-removal(next ptr, prev ptr) when close won 2015-10-28 14:42:47 +05:30
Janmejay Singh
31928aeb74 fixed stats setup for imptcp io_q stats 2015-10-28 14:42:47 +05:30
Janmejay Singh
49df782820 moved from O(worker) assignment model to queue based model for imptcp io-work 2015-10-28 14:42:35 +05:30
Janmejay Singh
11bd36c3cd better work assignment model in imptcp which ensures no blocking of poller for workers to receive messages 2015-10-28 14:41:35 +05:30
Janmejay Singh
a9a6a642f4 some cleanup, fixed a signal-call to signal with lock + fixed a calloc invocation that had size in place of count 2015-10-28 14:41:35 +05:30
Janmejay Singh
6c52f29d59 optimized payload-copy in processDataRcvd for octate-counted frames (as length is pre-known, it is possible to avoid coping char by char, as opposed to octate-stuffed frames) 2015-10-28 14:41:35 +05:30
Janmejay Singh
bce9b0f982 Ptcp config-option to enforce no-processing-on-poller thread. This allows poller to focus on... well polling (which ensures low artificial recv lag when worker-pool is correctly sized). 2015-10-28 14:41:35 +05:30
Janmejay Singh
873c7dd591 make imptcp worker-pool size configurable (without max bound) 2015-10-28 14:41:35 +05:30
Michael Biebl
6fbacdc41d typo fix: paramter → parameter
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=772490
2015-06-08 20:23:01 +02:00
Jan Gerhards
837a1fb178 imptcp: add config parameter for framing fix (framingfix.cisco.asa) 2015-02-24 16:52:27 +01:00
Rainer Gerhards
cc98f8b52a imptcp: tcp syslog receiver: permit frame to start with SP chars
this is effectively the same patch done to the imtcp subsystem, but
we have duplicate code, and so we need to apply it here, as well.
In the long term, it *may* make sense to unify the code.
2015-02-23 15:05:39 +01:00
Rainer Gerhards
c4d9cfe153 imptcp: make stats counter names consistent with what imudp, imtcp uses 2015-01-07 11:26:59 +01:00
Rainer Gerhards
423c3ac62c pstats: add "origin" paramter to stats records
see also: https://github.com/rsyslog/rsyslog/issues/119
2014-11-19 15:49:09 +01:00
Rainer Gerhards
ffaf9609a2 imptcp: fix printf format type 2014-07-15 12:24:14 +02:00
Rainer Gerhards
085928dac2 Merge branch 'v7-stable' into v8-stable 2014-07-13 15:31:35 +02:00
Rainer Gerhards
674e2aec3d regression fix: invalid ptr was passed
happend by merging patches this morning, never released
2014-07-13 14:57:32 +02:00
Rainer Gerhards
c2c8c26c87 Merge branch 'v7-stable' into v8-stable
Conflicts:
	plugins/imfile/imfile.c
2014-07-13 13:07:08 +02:00
Tomas Heinrich
f12d0c599f bugfix: prevent leaking a socket in case of an error
Error: RESOURCE_LEAK (CWE-772):
rsyslog-7.4.10/plugins/imptcp/imptcp.c:1252: open_arg: "AcceptConnReq(ptcplstn_t *, int *, prop_t **, prop_t **)" opens handle stored into "newSock".
rsyslog-7.4.10/plugins/imptcp/imptcp.c:615:2: open_fn: Returning handle opened by function "accept(int, __SOCKADDR_ARG, socklen_t * restrict)".
rsyslog-7.4.10/plugins/imptcp/imptcp.c:615:2: var_assign: Assigning: "iNewSock" = "accept(pLstn->sock, __SOCKADDR_ARG({ .__sockaddr__ = (struct sockaddr *)&addr}), &addrlen)".
rsyslog-7.4.10/plugins/imptcp/imptcp.c:623:3: noescape: Resource "iNewSock" is not freed or pointed-to in function "EnableKeepAlive(ptcplstn_t *, int)".
rsyslog-7.4.10/plugins/imptcp/imptcp.c:535:40: noescape: "EnableKeepAlive(ptcplstn_t *, int)" does not free or save its handle parameter "sock".
rsyslog-7.4.10/plugins/imptcp/imptcp.c:629:2: noescape: Resource "iNewSock" is not freed or pointed-to in function "fcntl(int, int, ...)".
rsyslog-7.4.10/plugins/imptcp/imptcp.c:634:3: noescape: Resource "iNewSock" is not freed or pointed-to in function "fcntl(int, int, ...)".
rsyslog-7.4.10/plugins/imptcp/imptcp.c:641:2: var_assign: Assigning: "*newSock" = "iNewSock".
rsyslog-7.4.10/plugins/imptcp/imptcp.c:1260: leaked_handle: Handle variable "newSock" going out of scope leaks the handle.
2014-07-11 15:19:44 +02:00
Tomas Heinrich
b4329a2c23 bugfix: plug more memleaks in imptcp
Error: RESOURCE_LEAK (CWE-772):
rsyslog-7.4.10/plugins/imptcp/imptcp.c:1120: alloc_fn: Storage is returned from allocation function "malloc(size_t)".
rsyslog-7.4.10/plugins/imptcp/imptcp.c:1120: var_assign: Assigning: "pSrv" = storage returned from "malloc(136UL)".
rsyslog-7.4.10/plugins/imptcp/imptcp.c:1159: leaked_storage: Variable "pSrv" going out of scope leaks the storage it points to.
2014-07-11 15:19:44 +02:00
Tomas Heinrich
e4d0e1b8e4 bugfix: plug more memleaks in imptcp 2014-07-11 15:19:44 +02:00
Tomas Heinrich
6d1eab822a bugfix: don't add session to the server upon failure
The session should be added after everything else is completed.
2014-07-11 15:19:44 +02:00
Tomas Heinrich
88c9c3054f bugfix: plug more memleaks in imptcp
Error: RESOURCE_LEAK (CWE-772):
rsyslog-7.4.10/plugins/imptcp/imptcp.c:964: alloc_fn: Storage is returned from allocation function "malloc(size_t)".
rsyslog-7.4.10/plugins/imptcp/imptcp.c:964: var_assign: Assigning: "pSess" = storage returned from "malloc(88UL)".
rsyslog-7.4.10/plugins/imptcp/imptcp.c:987: leaked_storage: Variable "pSess" going out of scope leaks the storage it points to.
2014-07-11 15:19:44 +02:00
Tomas Heinrich
106d19ae53 bugfix: don't add listener to the server upon failure
The listener should be added after everything else is completed.
2014-07-11 15:19:43 +02:00
Tomas Heinrich
d372830d87 bugfix: plug memleaks in imptcp
Error: RESOURCE_LEAK (CWE-772):
rsyslog-7.4.10/plugins/imptcp/imptcp.c:925: alloc_fn: Storage is returned from allocation function "malloc(size_t)".
rsyslog-7.4.10/plugins/imptcp/imptcp.c:925: var_assign: Assigning: "pLstn" = storage returned from "malloc(56UL)".
rsyslog-7.4.10/plugins/imptcp/imptcp.c:951: leaked_storage: Variable "pLstn" going out of scope leaks the storage it points to.
2014-07-11 15:19:43 +02:00
Tomas Heinrich
a6c4e18780 bugfix: propagate an error code
Previously, the return value was lost as iRet is overwritten in
CHKiRet(). The error code is not handled currently thus the utility is
disputable.
2014-07-11 15:19:43 +02:00
Rainer Gerhards
2d4348112f Merge branch 'v7-stable' into v8-stable 2014-06-23 12:04:34 +02:00
Susant Sahani
14fe6db4e9 imtcp: fix busy-loop in the tcp listener
This patch fixes the high CPU usage when rsyslog
run out of FDs

reference
http://lists.adiscon.net/pipermail/rsyslog/2013-October/034488.html

Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
Signed-off-by: Susant Sahani <susant@redhat.com>
2014-06-18 20:08:27 +02:00
Rainer Gerhards
01ab68f4e5 improve debug log in regard to max message size 2014-05-30 13:56:51 +02:00
Rainer Gerhards
3118fecb45 Merge branch 'v7-stable' into v7-devel
Conflicts:
	plugins/imptcp/imptcp.c
2013-12-18 15:00:02 +01:00
Rainer Gerhards
5c4973ca7e fix internal messages with LF in them
Thanks to Ahto Truu for spotting this problem.
2013-12-18 14:54:33 +01:00
Rainer Gerhards
4066d4cb4f Merge branch 'c9'
Conflicts:
	plugins/imptcp/imptcp.c
2013-10-11 18:19:16 +02:00
Rainer Gerhards
0eb0562fe6 imptcp: add "defaultTZ" input parameter 2013-10-11 18:18:04 +02:00
Rainer Gerhards
7b9f421f1a experimental: make impstats return delta values where possible
Conflicts:

	plugins/impstats/impstats.c
	plugins/imptcp/imptcp.c
2013-09-09 15:49:31 +02:00
Rainer Gerhards
fbc737d650 experimental: make impstats return delta values where possible 2013-09-07 15:58:09 +02:00
Rainer Gerhards
199f01614c cleanup 2013-07-15 17:47:04 +02:00
Rainer Gerhards
11e67b1c10 Merge branch 'master' into master-zipflush
Conflicts:
	plugins/imptcp/imptcp.c
2013-07-15 17:43:06 +02:00
Rainer Gerhards
54a4e88953 bugfix: stream compression in imptcp caused timestamp to be corrupted 2013-07-15 17:37:25 +02:00
Rainer Gerhards
04e1f5d330 milestone: tcp stream compression support for transaction boundaries 2013-07-15 16:04:44 +02:00