Commit 972470b1 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(add_to_kill_list): Don't write a log message when the connection is

	already present on the kill list.  With the liboop callbacks
	that can happen and is not an error.
(write_err_cb): Don't log an error for ECONNRESET.
(read_from_connection): Removed left-over debug code.
(enable_idle_check): Ditto.
(check_idle_callback): Ditto.
parent e603d18d
/* /*
* $Id: connections.c,v 0.93 2003/07/12 00:17:26 ceder Exp $ * $Id: connections.c,v 0.94 2003/07/12 09:43:17 ceder Exp $
* Copyright (C) 1991-2002 Lysator Academic Computer Association. * Copyright (C) 1991-2002 Lysator Academic Computer Association.
* *
* This file is part of the LysKOM server. * This file is part of the LysKOM server.
...@@ -526,11 +526,7 @@ add_to_kill_list(Connection *conn) ...@@ -526,11 +526,7 @@ add_to_kill_list(Connection *conn)
for (i = 0; i < kill_list_size; i++) for (i = 0; i < kill_list_size; i++)
if (kill_list[i] == conn->session_no) if (kill_list[i] == conn->session_no)
{
kom_log("add_to_kill_list(%ld): already present as %d of %d.\n",
conn->session_no, i, kill_list_size);
return; return;
}
if (kill_list == NULL) if (kill_list == NULL)
{ {
...@@ -695,8 +691,9 @@ write_err_cb(struct isc_mcb *UNUSED(cb_mcb), ...@@ -695,8 +691,9 @@ write_err_cb(struct isc_mcb *UNUSED(cb_mcb),
void *user) void *user)
{ {
Connection * cp = user; Connection * cp = user;
kom_log("Failed to write to client %lu from %s: %s\n", if (saved_errno != ECONNRESET)
cp->session_no, cp->peer, strerror(saved_errno)); kom_log("Failed to write to client %lu from %s: %s\n",
cp->session_no, cp->peer, strerror(saved_errno));
add_to_kill_list(cp); add_to_kill_list(cp);
} }
...@@ -843,7 +840,6 @@ read_from_connection(Connection *conn) ...@@ -843,7 +840,6 @@ read_from_connection(Connection *conn)
if (conn->penalty >= param.max_penalty) if (conn->penalty >= param.max_penalty)
{ {
// kom_log("Disabling %d\n", conn->isc_session->fd);
isc_disable(conn->isc_session); isc_disable(conn->isc_session);
queue_add(conn); queue_add(conn);
} }
...@@ -886,7 +882,6 @@ enable_idle_check(void) ...@@ -886,7 +882,6 @@ enable_idle_check(void)
oop_source *source = oop_sys_source(kom_server_oop_src); oop_source *source = oop_sys_source(kom_server_oop_src);
source->on_time(source, OOP_TIME_NOW, check_idle_callback, NULL); source->on_time(source, OOP_TIME_NOW, check_idle_callback, NULL);
// kom_log("Arming idle check\n");
} }
...@@ -898,8 +893,6 @@ check_idle_callback(oop_source *UNUSED(source), ...@@ -898,8 +893,6 @@ check_idle_callback(oop_source *UNUSED(source),
Connection *c; Connection *c;
Connection *next; Connection *next;
//kom_log("On entry: idle=%d, work_done=%d, queue_first=%p\n",
// is_idle, work_done, queue_first);
set_time(); set_time();
is_idle = !work_done; is_idle = !work_done;
work_done = FALSE; work_done = FALSE;
...@@ -908,7 +901,6 @@ check_idle_callback(oop_source *UNUSED(source), ...@@ -908,7 +901,6 @@ check_idle_callback(oop_source *UNUSED(source),
{ {
is_idle = FALSE; is_idle = FALSE;
++penalty_generation; ++penalty_generation;
// kom_log("Penalty generation %d\n", penalty_generation);
for (next = queue_first; next != NULL; ) for (next = queue_first; next != NULL; )
{ {
...@@ -918,8 +910,6 @@ check_idle_callback(oop_source *UNUSED(source), ...@@ -918,8 +910,6 @@ check_idle_callback(oop_source *UNUSED(source),
if (c->penalty < param.low_penalty) if (c->penalty < param.low_penalty)
{ {
queue_remove(c); queue_remove(c);
//kom_log("Enabling %d (penalty=%d)\n", c->isc_session->fd,
// c->penalty);
isc_enable(c->isc_session); isc_enable(c->isc_session);
read_from_connection(c); read_from_connection(c);
} }
...@@ -929,8 +919,6 @@ check_idle_callback(oop_source *UNUSED(source), ...@@ -929,8 +919,6 @@ check_idle_callback(oop_source *UNUSED(source),
if (!is_idle) if (!is_idle)
enable_idle_check(); enable_idle_check();
// kom_log("On exit: idle=%d, work_done=%d, queue_first=%p\n",
// is_idle, work_done, queue_first);
return OOP_CONTINUE; return OOP_CONTINUE;
} }
......
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