From 2f5f0343d9d03ddee91bd6bbe2c2056f394abb1c Mon Sep 17 00:00:00 2001 From: trisk Date: Sat, 7 Jul 2007 07:14:54 +0000 Subject: [PATCH] * hack: Make NMAPReadConfigFile() retry in case store is not yet ready. --- src/libs/nmap/nmap.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/libs/nmap/nmap.c b/src/libs/nmap/nmap.c index 3567457..1d3fa62 100644 --- a/src/libs/nmap/nmap.c +++ b/src/libs/nmap/nmap.c @@ -1274,8 +1274,16 @@ NMAPReadConfigFile(const unsigned char *file, unsigned char **output) char buffer[CONN_BUFSIZE + 1]; CCode ccode; BOOL retcode = FALSE; + int tries; - conn = NMAPConnect("127.0.0.1", NULL); + /* FIXME: caller should be notified when store is ready */ + for (tries = 0; tries < 5; tries++) { + conn = NMAPConnect("127.0.0.1", NULL); + if (conn) { + break; + } + XplDelay(1000); + } if (!conn) { printf("could not connect to store\n"); return FALSE;