Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
lyskom-server-ceder-1616-generations-topgit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Per Cederqvist
lyskom-server-ceder-1616-generations-topgit
Commits
6ba301c9
Commit
6ba301c9
authored
32 years ago
by
Per Cederqvist
Browse files
Options
Downloads
Patches
Plain Diff
Use isc 0.97.
add_to_kill_list(): Check that the connection isn't already on the kill list.
parent
be23e7f7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/server/ChangeLog
+28
-0
28 additions, 0 deletions
src/server/ChangeLog
src/server/connections.c
+32
-19
32 additions, 19 deletions
src/server/connections.c
with
60 additions
and
19 deletions
src/server/ChangeLog
+
28
−
0
View file @
6ba301c9
Thu Apr 16 00:46:50 1992 Per Cederqvist (ceder@lysator)
* Use isc-0.97:
* Makefile (LIBS): -lisc-new instead of -lold-isc.
* Makefile (GENOBJS, GEN_SRCS): Include isc-malloc.[oc].
* isc-malloc.[hc]: New files. (Compare string-malloc.[hc]).
* Various namechanges:
ISCMCB -> IscMaster
ISCECB -> IscEvent
ISCSCB -> IscSession
* Use isc_destroy() instead of isc_close().
* isc-interfacs.h: Include <isc-new.h> instead of <isc.h>.
* lyskomd.h (listen_client, listen_mux): Now (IscSession *).
Updated all references.
* lyskomd.h (kom_server_mcb): Now declared here.
* ramkomd.c ("isc-malloc.h"): Include instead of <isc-dump.h>.
* ramkomd.c (server_init): Use the new configuration scheme.
(Needs som further investigation).
* ramkomd.c (dump_exit_statistics): Don't
dump_isc_message_counts() since it doesn't exist.
Wed Apr 15 19:52:20 1992 Per Cederqvist (ceder@lysator)
* connections.c (add_to_kill_list): Check if the connection
already was on the kill-list. If so, print a diagnostic and
return.
Tue Apr 14 17:21:26 1992 Per Cederqvist (ceder@lysator)
Tue Apr 14 17:21:26 1992 Per Cederqvist (ceder@lysator)
* Version 1.1.2 (not released).
* Version 1.1.2 (not released).
...
...
This diff is collapsed.
Click to expand it.
src/server/connections.c
+
32
−
19
View file @
6ba301c9
/*
/*
* $Id: connections.c,v 0.1
6
1992/04/1
1
2
0:02:20
ceder Exp $
* $Id: connections.c,v 0.1
7
1992/04/1
5
2
2:58:48
ceder Exp $
* Copyright (C) 1991 Lysator Academic Computer Association.
* Copyright (C) 1991 Lysator Academic Computer Association.
*
*
* This file is part of the LysKOM server.
* This file is part of the LysKOM server.
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
* Created by Willf|r 31/3-90. Mostly written by ceder.
* Created by Willf|r 31/3-90. Mostly written by ceder.
*/
*/
static
char
*
rcsid
=
"$Id: connections.c,v 0.1
6
1992/04/1
1
2
0:02:20
ceder Exp $"
;
static
char
*
rcsid
=
"$Id: connections.c,v 0.1
7
1992/04/1
5
2
2:58:48
ceder Exp $"
;
#include
<errno.h>
#include
<errno.h>
...
@@ -67,7 +67,7 @@ static char *rcsid = "$Id: connections.c,v 0.16 1992/04/11 20:02:20 ceder Exp $"
...
@@ -67,7 +67,7 @@ static char *rcsid = "$Id: connections.c,v 0.16 1992/04/11 20:02:20 ceder Exp $"
#include
"internal-connections.h"
#include
"internal-connections.h"
#include
"rfc931.h"
#include
"rfc931.h"
I
SCMCB
*
kom_server_mcb
=
NULL
;
I
scMaster
*
kom_server_mcb
=
NULL
;
Connection
*
active_connection
=
NULL
;
Connection
*
active_connection
=
NULL
;
/*
/*
...
@@ -401,7 +401,7 @@ mux_handle_packet(Mux *mux)
...
@@ -401,7 +401,7 @@ mux_handle_packet(Mux *mux)
cp
->
session_no
,
cp
->
session_no
,
(
int
)
cp
->
hostname
.
len
,
(
int
)
cp
->
hostname
.
len
,
cp
->
hostname
.
string
,
cp
->
hostname
.
string
,
mux
->
scb
->
info
.
tcp
.
hostname
));
isc_gethostname
(
mux
->
scb
->
info
.
tcp
.
raddr
,
NULL
,
0
)
));
BUG
((
" is connecting]
\n
"
));
BUG
((
" is connecting]
\n
"
));
break
;
break
;
...
@@ -419,7 +419,7 @@ mux_handle_packet(Mux *mux)
...
@@ -419,7 +419,7 @@ mux_handle_packet(Mux *mux)
BUG
((
"
\n
[Client %d via MUX(%s)"
,
BUG
((
"
\n
[Client %d via MUX(%s)"
,
cp
->
session_no
,
cp
->
session_no
,
mux
->
scb
->
info
.
tcp
.
hostname
));
isc_gethostname
(
mux
->
scb
->
info
.
tcp
.
raddr
,
NULL
,
0
)
));
BUG
((
" is logging out by request]
\n
"
));
BUG
((
" is logging out by request]
\n
"
));
add_to_kill_list
(
cp
);
add_to_kill_list
(
cp
);
...
@@ -464,13 +464,13 @@ mux_logout(Mux *mp)
...
@@ -464,13 +464,13 @@ mux_logout(Mux *mp)
{
{
BUG
((
"
\n
[Client %d via MUX(%s)"
,
BUG
((
"
\n
[Client %d via MUX(%s)"
,
mp
->
client_v
[
i
].
conn
->
session_no
,
mp
->
client_v
[
i
].
conn
->
session_no
,
mp
->
scb
->
info
.
tcp
.
hostname
));
isc_gethostname
(
mp
->
scb
->
info
.
tcp
.
raddr
,
NULL
,
0
)
));
BUG
((
" is logging out by MUX shutdown]
\n
"
));
BUG
((
" is logging out by MUX shutdown]
\n
"
));
logout_client
(
mp
->
client_v
[
i
].
conn
);
logout_client
(
mp
->
client_v
[
i
].
conn
);
end_of_atomic
(
FALSE
);
end_of_atomic
(
FALSE
);
}
}
isc_
close
(
mp
->
scb
);
isc_
destroy
(
kom_server_mcb
,
mp
->
scb
);
mux_destruct
(
mp
);
mux_destruct
(
mp
);
}
}
...
@@ -639,6 +639,16 @@ int kill_list_size = 0;
...
@@ -639,6 +639,16 @@ int kill_list_size = 0;
void
void
add_to_kill_list
(
Connection
*
conn
)
add_to_kill_list
(
Connection
*
conn
)
{
{
int
i
;
for
(
i
=
0
;
i
<
kill_list_size
;
i
++
)
if
(
kill_list
[
kill_list_size
]
==
conn
->
session_no
)
{
log
(
"add_to_kill_list(%d): already present as %d of %d.
\n
"
,
conn
->
session_no
,
i
,
kill_list_size
);
return
;
}
if
(
kill_list
==
NULL
)
if
(
kill_list
==
NULL
)
{
{
if
(
kill_list_size
!=
0
)
if
(
kill_list_size
!=
0
)
...
@@ -694,7 +704,7 @@ check_kill_flg(void)
...
@@ -694,7 +704,7 @@ check_kill_flg(void)
}
}
static
void
static
void
login_request
(
I
SCECB
*
event
)
login_request
(
I
scEvent
*
event
)
{
{
Connection
*
cp
;
Connection
*
cp
;
char
*
realuser
;
char
*
realuser
;
...
@@ -704,7 +714,7 @@ login_request(ISCECB *event)
...
@@ -704,7 +714,7 @@ login_request(ISCECB *event)
BUG
((
"Connection attempt rejected.
\n
"
));
BUG
((
"Connection attempt rejected.
\n
"
));
isc_printf
(
event
->
session
,
"%s"
,
"%% No connections left.
\n
"
);
isc_printf
(
event
->
session
,
"%s"
,
"%% No connections left.
\n
"
);
isc_flush
(
event
->
session
);
isc_flush
(
event
->
session
);
isc_
close
(
event
->
session
);
isc_
destroy
(
kom_server_mcb
,
event
->
session
);
async_rejected_connection
();
async_rejected_connection
();
return
;
return
;
...
@@ -715,11 +725,11 @@ login_request(ISCECB *event)
...
@@ -715,11 +725,11 @@ login_request(ISCECB *event)
{
{
isc_printf
(
event
->
session
,
"%s"
,
"%% No logins allowed.
\n
"
);
isc_printf
(
event
->
session
,
"%s"
,
"%% No logins allowed.
\n
"
);
isc_flush
(
event
->
session
);
isc_flush
(
event
->
session
);
isc_
close
(
event
->
session
);
isc_
destroy
(
kom_server_mcb
,
event
->
session
);
return
;
return
;
}
}
if
(
event
->
session
->
info
.
tcp
.
listen
==
listen_mux
)
if
(
event
->
session
==
listen_mux
)
{
{
/* Multiplexer requesting connection */
/* Multiplexer requesting connection */
...
@@ -729,7 +739,8 @@ login_request(ISCECB *event)
...
@@ -729,7 +739,8 @@ login_request(ISCECB *event)
event
->
session
->
udg
=
mux_create
(
MUX_TYPE_MUX
,
event
->
session
);
event
->
session
->
udg
=
mux_create
(
MUX_TYPE_MUX
,
event
->
session
);
BUG
((
"MUX #%d at %s connecting.
\n
"
,
BUG
((
"MUX #%d at %s connecting.
\n
"
,
(
int
)
event
->
session
,
event
->
session
->
info
.
tcp
.
hostname
));
(
int
)
event
->
session
,
isc_gethostname
(
event
->
session
->
info
.
tcp
.
raddr
,
NULL
,
0
)));
}
}
else
else
{
{
...
@@ -743,7 +754,9 @@ login_request(ISCECB *event)
...
@@ -743,7 +754,9 @@ login_request(ISCECB *event)
cp
=
new_client
();
cp
=
new_client
();
cp
->
mux
=
event
->
session
->
udg
;
cp
->
mux
=
event
->
session
->
udg
;
s_crea_str
(
&
cp
->
hostname
,
event
->
session
->
info
.
tcp
.
hostname
);
s_crea_str
(
&
cp
->
hostname
,
isc_gethostname
(
event
->
session
->
info
.
tcp
.
raddr
,
NULL
,
0
));
/* Get the real user name, as returned by the Ident protocol
/* Get the real user name, as returned by the Ident protocol
(rfc 931). */
(rfc 931). */
...
@@ -754,20 +767,20 @@ login_request(ISCECB *event)
...
@@ -754,20 +767,20 @@ login_request(ISCECB *event)
mux_addclient
(
event
->
session
->
udg
,
0
,
cp
);
mux_addclient
(
event
->
session
->
udg
,
0
,
cp
);
BUG
((
"
\n
[Client %d from %s"
,
cp
->
session_no
,
BUG
((
"
\n
[Client %d from %s"
,
cp
->
session_no
,
event
->
session
->
info
.
tcp
.
hostname
));
isc_gethostname
(
event
->
session
->
info
.
tcp
.
raddr
,
NULL
,
0
)
));
BUG
((
" is connecting]
\n
"
));
BUG
((
" is connecting]
\n
"
));
}
}
}
}
static
void
static
void
logout_request
(
I
SCECB
*
event
)
logout_request
(
I
scEvent
*
event
)
{
{
Connection
*
cp
;
Connection
*
cp
;
if
(
event
->
session
->
udg
->
type
==
MUX_TYPE_MUX
)
if
(
event
->
session
->
udg
->
type
==
MUX_TYPE_MUX
)
{
{
BUG
((
"
\n
[MUX #%d at %s"
,
(
int
)
event
->
session
,
BUG
((
"
\n
[MUX #%d at %s"
,
(
int
)
event
->
session
,
event
->
session
->
info
.
tcp
.
hostname
));
isc_gethostname
(
event
->
session
->
info
.
tcp
.
raddr
,
NULL
,
0
)
));
BUG
((
" is logging out]
\n
"
));
BUG
((
" is logging out]
\n
"
));
/*
/*
...
@@ -780,7 +793,7 @@ logout_request(ISCECB *event)
...
@@ -780,7 +793,7 @@ logout_request(ISCECB *event)
cp
=
event
->
session
->
udg
->
client_v
[
0
].
conn
;
cp
=
event
->
session
->
udg
->
client_v
[
0
].
conn
;
BUG
((
"
\n
[Client %d from %s"
,
cp
->
session_no
,
BUG
((
"
\n
[Client %d from %s"
,
cp
->
session_no
,
event
->
session
->
info
.
tcp
.
hostname
));
isc_gethostname
(
event
->
session
->
info
.
tcp
.
raddr
,
NULL
,
0
)
));
BUG
((
" is logging out]
\n
"
));
BUG
((
" is logging out]
\n
"
));
add_to_kill_list
(
cp
);
add_to_kill_list
(
cp
);
...
@@ -789,7 +802,7 @@ logout_request(ISCECB *event)
...
@@ -789,7 +802,7 @@ logout_request(ISCECB *event)
static
void
static
void
message_request
(
I
SCECB
*
event
)
message_request
(
I
scEvent
*
event
)
{
{
Connection
*
cp
;
Connection
*
cp
;
String
tmp_str
;
String
tmp_str
;
...
@@ -825,7 +838,7 @@ timevaldiff(struct timeval a,
...
@@ -825,7 +838,7 @@ timevaldiff(struct timeval a,
void
void
toploop
(
void
)
toploop
(
void
)
{
{
I
SCECB
*
event
;
I
scEvent
*
event
;
Bool
pending_input
=
TRUE
;
/* Should be TRUE whenever there
Bool
pending_input
=
TRUE
;
/* Should be TRUE whenever there
is or might be pending input
is or might be pending input
from any client in the unparsed
from any client in the unparsed
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment