/*
- * $Id: db_param.c,v 1.2 2005-04-28 20:49:47 bfernhomberg Exp $
+ * $Id: db_param.c,v 1.3 2009-02-04 20:28:01 didg Exp $
*
* Copyright (C) Joerg Lenneis 2003
* All Rights Reserved. See COPYING.
#define DEFAULT_FLUSH_FREQUENCY 100
#define DEFAULT_FLUSH_INTERVAL 30
#define DEFAULT_USOCK_FILE "usock"
-#define DEFAULT_FD_TABLE_SIZE 16
+#define DEFAULT_FD_TABLE_SIZE 64
#define DEFAULT_IDLE_TIMEOUT 600
#define DEFAULT_CHECK 0
/*
- * $Id: cnid_dbd.c,v 1.4 2005-09-07 15:23:22 didg Exp $
+ * $Id: cnid_dbd.c,v 1.5 2009-02-04 20:28:01 didg Exp $
*
* Copyright (C) Joerg Lenneis 2003
* All Rights Reserved. See COPYING.
struct timeval tv;
time_t orig, t;
int silent = 1;
+ int clean = 1; /* no errors so far - to prevent sleep on first try */
if (db->changed) {
/* volume and db don't have the same timestamp
will log messages if something goes wrong again */
if (db->fd != -1) {
close(db->fd);
+ db->fd = -1; /* FD not valid... will need to reconnect */
}
time(&t);
if (t - orig > MAX_DELAY) {
return -1;
}
- /* sleep a little before retry */
- db->fd = -1;
- tv.tv_usec = 0;
- tv.tv_sec = 5;
- select(0, NULL, NULL, NULL, &tv);
+ if (!clean) { /* don't sleep if just got disconnected by cnid server */
+ /* sleep a little before retry */
+ tv.tv_usec = 0;
+ tv.tv_sec = 5;
+ select(0, NULL, NULL, NULL, &tv); /* sleep for 5 seconds */
+ } else {
+ clean = 0; /* false... next time sleep */
+ }
}
return -1;
}