mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-15 10:30:40 +01:00
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.
This commit is contained in:
parent
db6ef15992
commit
c8a2969580
@ -665,10 +665,10 @@ finalize_it: /*EMPTY to keep the compiler happy */;
|
|||||||
|
|
||||||
|
|
||||||
static int
|
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;
|
size_t lenSent;
|
||||||
int r, err;
|
int r;
|
||||||
|
|
||||||
lenSent = 0;
|
lenSent = 0;
|
||||||
while(lenSent != lenBuf) {
|
while(lenSent != lenBuf) {
|
||||||
@ -676,7 +676,7 @@ sendPlainTCP(int socknum, char *buf, size_t lenBuf, int *ret_errno)
|
|||||||
if(r > 0) {
|
if(r > 0) {
|
||||||
lenSent += r;
|
lenSent += r;
|
||||||
} else {
|
} else {
|
||||||
err = errno;
|
*ret_errno = errno;
|
||||||
goto finalize_it;
|
goto finalize_it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user