Commit 11c44ac7 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(idle_cb): New static function.

(login_request): Pass idle_cb() to isc_set_read_callback().
parent a20fdd80
/*
* $Id: connections.c,v 0.112 2003/08/01 13:14:36 ceder Exp $
* $Id: connections.c,v 0.113 2003/08/02 20:45:09 ceder Exp $
* Copyright (C) 1991-2002 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -738,6 +738,19 @@ stale_cb(struct isc_mcb *UNUSED(cb_mcb),
}
static void
idle_cb(struct isc_mcb *UNUSED(cb_mcb),
struct isc_scb *UNUSED(cb_session),
void *user)
{
Connection *cp = user;
kom_log("Client %lu from %s has been idle too long. Killing it.\n",
cp->session_no, cp->peer);
cp->penalty += param.max_penalty;
add_to_kill_list(cp);
}
static void
login_request(struct isc_scb *session)
{
......@@ -816,7 +829,7 @@ login_request(struct isc_scb *session)
dump_connections();
isc_set_read_callback(session, data_available_callback, write_err_cb,
stale_cb, cp);
stale_cb, idle_cb, cp);
}
static void
......
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