Commit 2aa2c69c authored by Per Cederqvist's avatar Per Cederqvist

(accept_async): Don't accept 1, 2, 3, 4 or 10 (which are in the

	interval [0..ay_dummy_last) but not used).  Complain about the
	first rejected async number, not the last.
parent 5626cdd4
/*
* $Id: session.c,v 0.39 1998/07/08 17:03:13 ceder Exp $
* $Id: session.c,v 0.40 1998/10/06 07:23:33 ceder Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1996 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -29,7 +29,7 @@
*/
static const char *
rcsid = "$Id: session.c,v 0.39 1998/07/08 17:03:13 ceder Exp $";
rcsid = "$Id: session.c,v 0.40 1998/10/06 07:23:33 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -889,6 +889,7 @@ accept_async(Number_list *num_list)
{
int i;
Success result;
int found;
result = OK;
......@@ -916,17 +917,41 @@ accept_async(Number_list *num_list)
/*
* Enter the new accept list -- silently ignore requests for
* Enter the new accept list -- non-silently ignore requests for
* messages that this version of the server doesn't understand.
*/
for (i = 0; i < num_list->length; i++)
{
found = 0;
if (num_list->data[i] >= 0 &&
num_list->data[i] < ay_dummy_last)
active_connection->want_async[num_list->data[i]] = TRUE;
if (num_list->data[i] >= ay_dummy_last)
{
switch ((Async)num_list->data[i])
{
case ay_new_text_old:
case ay_new_name:
case ay_i_am_on:
case ay_sync_db:
case ay_leave_conf:
case ay_login:
case ay_rejected_connection:
case ay_send_message:
case ay_logout:
case ay_deleted_text:
case ay_new_text:
found = 1;
active_connection->want_async[num_list->data[i]] = TRUE;
break;
case ay_dummy_last:
break;
/* Trick: since we don't use a default label here gcc
will warn if new values are added to the Async enum
but not to this switch. */
}
}
if (!found && result == OK) /* Remember the first offender. */
{
err_stat = num_list->data[i];
kom_errno = KOM_UNKNOWN_ASYNC;
......
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