summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-01-14 08:30:42 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2013-01-14 08:37:18 +0100
commit11249054b326b67fab5795bd6d16dcc1c234ae76 (patch)
tree16ff242f726b3f1148c3b4e4caab059358d41fb2
parent0014a37998d3f516be5db3aabeff4166544af5f7 (diff)
downloadrsyslog-11249054b326b67fab5795bd6d16dcc1c234ae76.tar.gz
rsyslog-11249054b326b67fab5795bd6d16dcc1c234ae76.tar.bz2
rsyslog-11249054b326b67fab5795bd6d16dcc1c234ae76.zip
tcpflood: properly terminate when sending small files
-rw-r--r--tests/tcpflood.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/tcpflood.c b/tests/tcpflood.c
index 8fd347f1..4a3199c8 100644
--- a/tests/tcpflood.c
+++ b/tests/tcpflood.c
@@ -429,6 +429,8 @@ int sendMessages(struct instdata *inst)
}
}
genMsg(buf, sizeof(buf), &lenBuf, inst); /* generate the message to send according to params */
+ if(lenBuf == 0)
+ break; /* terminate when no message could be generated */
if(transport == TP_TCP) {
if(sockArray[socknum] == -1) {
/* connection was dropped, need to re-establish */