Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Per Cederqvist
lyskom-server-ceder-1616-generations-topgit
Commits
61010735
Commit
61010735
authored
Jun 14, 1996
by
David Byers
Browse files
(accept_async): New function implementing the accept-async protocol request
parent
5ac9303a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/server/session.c
View file @
61010735
/*
* $Id: session.c,v 0.2
8
199
4/12/31 12:00:52 ced
er Exp $
* $Id: session.c,v 0.2
9
199
6/06/14 15:41:02 by
er
s
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.2
8
199
4/12/31 12:00:52 ced
er Exp $"
;
static
char
*
rcsid
=
"$Id: session.c,v 0.2
9
199
6/06/14 15:41:02 by
er
s
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
;
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment