Commit 225a6dcb authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(dns_resolution): Don't re-enable idle check during shutdown. Simplify code.

(toploop): Simplify code by using enable_idle_check().
parent 90e2b5c5
/*
* $Id: connections.c,v 0.116 2003/08/06 06:59:13 ceder Exp $
* $Id: connections.c,v 0.117 2003/08/06 21:49:53 ceder Exp $
* Copyright (C) 1991-2002 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -690,8 +690,6 @@ dns_resolution(struct isc_scb *scb,
Connection *conn;
char *hostname = NULL;
busy();
update_stat(STAT_DNS_QUEUE, -1);
conn = scb->udg;
......@@ -712,8 +710,11 @@ dns_resolution(struct isc_scb *scb,
diff = timeval_diff_d(after, conn->connect_time);
if (res == isc_resolve_h_errno)
busy();
switch (res)
{
case isc_resolve_h_errno:
if (hostname == NULL)
hostname = s_crea_c_str(scb->remote);
......@@ -728,14 +729,20 @@ dns_resolution(struct isc_scb *scb,
else
kom_log("Unknown resolver error %ld looking up %s.\n",
errcode, hostname);
}
break;
if (res == isc_resolve_adns_error)
{
case isc_resolve_adns_error:
if (hostname == NULL)
hostname = s_crea_c_str(scb->remote);
kom_log("Error looking up %s: %s\n", hostname, adns_strerror(errcode));
break;
case isc_resolve_aborted:
abort();
case isc_resolve_ok:
break;
}
if (diff > param.dns_log_threshold)
......@@ -1114,7 +1121,7 @@ toploop(void)
start_garb_thread(source);
/* Hack to find out when we are idle. */
source->on_time(source, OOP_TIME_NOW, check_idle_callback, NULL);
enable_idle_check();
/* Save the database even if we happen to be idle. */
saver_timer = OOP_TIME_NOW;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment