Commit 61010735 authored by David Byers's avatar David Byers
Browse files

(accept_async): New function implementing the accept-async protocol request

parent 5ac9303a
/*
* $Id: session.c,v 0.28 1994/12/31 12:00:52 ceder Exp $
* $Id: session.c,v 0.29 1996/06/14 15:41:02 byers Exp $
* Copyright (C) 1991, 1992, 1993, 1994 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -28,7 +28,7 @@
* Session control and miscellaneous.
*/
static char *rcsid = "$Id: session.c,v 0.28 1994/12/31 12:00:52 ceder Exp $";
static char *rcsid = "$Id: session.c,v 0.29 1996/06/14 15:41:02 byers Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -754,3 +754,65 @@ get_client_version (Session_no session_no,
return FAILURE;
}
}
extern Success
accept_async(Number_list *num_list)
{
int i;
/*
* Check agains maliciously long arrays
*/
if (num_list->length > ay_dummy_last)
{
kom_errno = KOM_INDEX_OUT_OF_RANGE;
return FAILURE;
}
/*
* Clear the accept list
*/
for (i = 0; i < ay_dummy_last; i++)
{
active_connection->want_async[i] = 0;
}
/*
* Enter the new accept list
*/
for (i = 0; i < num_list->length; i++)
{
if (num_list->data[i] >= 0 &&
num_list->data[i] < ay_dummy_last)
active_connection->want_async[num_list->data[i]] = 1;
}
return OK;
}
extern Success
query_async(Number_list *result)
{
static long temp[ay_dummy_last];
int i;
result->length = 0;
for (i = 0; i < ay_dummy_last; i++)
{
if (active_connection->want_async[i] != 0)
{
temp[result->length] = i;
result->length += 1;
}
}
result->data = temp;
return OK;
}
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