*
* Created by: David C. Jedlinsky
*
- * $Id: zhm_server.c,v 1.17 1999/10/14 18:37:35 ghudson Exp $
+ * $Id: zhm_server.c,v 1.18 2000/05/08 16:00:08 ghudson Exp $
*
* Copyright (c) 1987 by the Massachusetts Institute of Technology.
* For copying and distribution information, see the file
#ifndef lint
#ifndef SABER
-static char rcsid_hm_server_c[] = "$Id: zhm_server.c,v 1.17 1999/10/14 18:37:35 ghudson Exp $";
+static char rcsid_hm_server_c[] = "$Id: zhm_server.c,v 1.18 2000/05/08 16:00:08 ghudson Exp $";
#endif /* SABER */
#endif /* lint */
static void boot_timeout __P((void *));
+static int get_serv_timeout __P((void));
static Timer *boot_timer = NULL;
+static int serv_rexmit_times[] = { 5, 10, 20, 40 };
+static int serv_timeouts = 0;
int serv_loop = 0;
extern u_short cli_port;
Zperr(ret);
com_err("hm", ret, "sending startup notice");
}
- boot_timer = timer_set_rel(SERV_TIMEOUT, boot_timeout, NULL);
+ boot_timer = timer_set_rel(get_serv_timeout(), boot_timeout, NULL);
}
/* Argument is whether we are detaching or really going down */
} else {
/* This is our server, handle the notice */
booting = 0;
+ serv_timeouts = 0;
if (boot_timer) {
timer_reset(boot_timer);
boot_timer = NULL;
static void boot_timeout(arg)
void *arg;
{
+ serv_timeouts++;
new_server(NULL);
}
+static int get_serv_timeout(void)
+{
+ int ind, ntimeouts;
+
+ ind = (numserv == 0) ? serv_timeouts : serv_timeouts / numserv;
+ ntimeouts = sizeof(serv_rexmit_times) / sizeof(*serv_rexmit_times);
+ if (ind >= ntimeouts)
+ ind = ntimeouts - 1;
+ return serv_rexmit_times[ind];
+}