summaryrefslogtreecommitdiffstats
path: root/tests/tcpflood.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-01-13 12:14:58 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2013-01-13 12:14:58 +0100
commit17d48fc49986af1e8e1cc2150213fe4f6111d7c6 (patch)
treeed8d4b549bf8a595a03355f9f7996dfe408faee3 /tests/tcpflood.c
parent25dd212bd0bbd68edf774221429bc59001794a7e (diff)
downloadrsyslog-17d48fc49986af1e8e1cc2150213fe4f6111d7c6.tar.gz
rsyslog-17d48fc49986af1e8e1cc2150213fe4f6111d7c6.tar.bz2
rsyslog-17d48fc49986af1e8e1cc2150213fe4f6111d7c6.zip
added capability to output thread-id-to-function debug info
This is a useful debug aid, but nothing of concern for regular users.
Diffstat (limited to 'tests/tcpflood.c')
-rw-r--r--tests/tcpflood.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/tcpflood.c b/tests/tcpflood.c
index c3e5b57e..b3cef2e0 100644
--- a/tests/tcpflood.c
+++ b/tests/tcpflood.c
@@ -347,7 +347,7 @@ genMsg(char *buf, size_t maxBuf, int *pLenBuf, struct instdata *inst)
/* get message from file */
do {
done = 1;
- *pLenBuf = fread(buf, 1, 1024, dataFP);
+ *pLenBuf = fread(buf, 1, MAX_EXTRADATA_LEN + 1024, dataFP);
if(*pLenBuf == 0) {
if(--numFileIterations > 0) {
rewind(dataFP);
@@ -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 */