diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-06-29 11:37:29 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-06-29 11:37:29 +0200 |
commit | 4822715a6e1ecc48d50a5450f93f02f785b8745a (patch) | |
tree | 6597c734b5bcddb963c1cccaed29ec5289ae87a6 /tests | |
parent | 6a29afc83f16c57d243b39b8e8d47f2ed909bae0 (diff) | |
download | rsyslog-4822715a6e1ecc48d50a5450f93f02f785b8745a.tar.gz rsyslog-4822715a6e1ecc48d50a5450f93f02f785b8745a.tar.xz rsyslog-4822715a6e1ecc48d50a5450f93f02f785b8745a.zip |
updated testbench to new init() behavior
the deferred activation of input modules broke part of the testbench -
but this was a testbench issue, not one of the patch
Diffstat (limited to 'tests')
-rw-r--r-- | tests/nettester.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/tests/nettester.c b/tests/nettester.c index b8816b7c..c9a978c5 100644 --- a/tests/nettester.c +++ b/tests/nettester.c @@ -107,6 +107,7 @@ tcpSend(char *buf, int lenBuf) { static int sock = INVALID_SOCKET; struct sockaddr_in addr; + int retries; if(sock == INVALID_SOCKET) { /* first time, need to connect to target */ @@ -122,10 +123,19 @@ tcpSend(char *buf, int lenBuf) fprintf(stderr, "inet_aton() failed\n"); return(1); } - if(connect(sock, (struct sockaddr*)&addr, sizeof(addr)) != 0) { - fprintf(stderr, "connect() failed\n"); - return(1); - } + retries = 0; + while(1) { /* loop broken inside */ + if(connect(sock, (struct sockaddr*)&addr, sizeof(addr)) == 0) { + break; + } else { + if(retries++ == 3) { + fprintf(stderr, "connect() failed\n"); + return(1); + } else { + sleep(1); + } + } + } } /* send test data */ |