43 lines
1.3 KiB
Diff
43 lines
1.3 KiB
Diff
From c8a2969580935121440f220af03d74ab1dfa5c11 Mon Sep 17 00:00:00 2001
|
|
From: Rainer Gerhards <rgerhards@adiscon.com>
|
|
Date: Wed, 13 Sep 2023 09:33:40 +0200
|
|
Subject: [PATCH] tcpflood bugfix: plain tcp send error not properly reported
|
|
|
|
The error code when plain tcp sending failed was improperly returned,
|
|
resulting in no meaningful error message.
|
|
|
|
Note: tcpflood is a testbench tool, not part of production rsyslog.
|
|
|
|
Reference:https://github.com/rsyslog/rsyslog/commit/c8a2969580935121440f220af03d74ab1dfa5c11
|
|
Conflict:NA
|
|
---
|
|
tests/tcpflood.c | 6 +++---
|
|
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/tests/tcpflood.c b/tests/tcpflood.c
|
|
index cff4a59dba..12781f55ff 100644
|
|
--- a/tests/tcpflood.c
|
|
+++ b/tests/tcpflood.c
|
|
@@ -665,10 +665,10 @@ genMsg(char *buf, size_t maxBuf, size_t *pLenBuf, struct instdata *inst)
|
|
|
|
|
|
static int
|
|
-sendPlainTCP(int socknum, char *buf, size_t lenBuf, int *ret_errno)
|
|
+sendPlainTCP(const int socknum, const char *const buf, const size_t lenBuf, int *const ret_errno)
|
|
{
|
|
size_t lenSent;
|
|
- int r, err;
|
|
+ int r;
|
|
|
|
lenSent = 0;
|
|
while(lenSent != lenBuf) {
|
|
@@ -676,7 +676,7 @@ sendPlainTCP(int socknum, char *buf, size_t lenBuf, int *ret_errno)
|
|
if(r > 0) {
|
|
lenSent += r;
|
|
} else {
|
|
- err = errno;
|
|
+ *ret_errno = errno;
|
|
goto finalize_it;
|
|
}
|
|
}
|