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
5de8b71f
Commit
5de8b71f
authored
31 years ago
by
Per Cederqvist
Browse files
Options
Downloads
Patches
Plain Diff
Include tmp-difftime.h.
(set_client_version, get_client_name, get_client_version): New functions.
parent
d04212ac
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/server/session.c
+63
-2
63 additions, 2 deletions
src/server/session.c
with
63 additions
and
2 deletions
src/server/session.c
+
63
−
2
View file @
5de8b71f
/*
* $Id: session.c,v 0.1
3
1993/0
1/16 23:18:18
ceder Exp $
* $Id: session.c,v 0.1
4
1993/0
8/05 01:08:43
ceder Exp $
* Copyright (C) 1991 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.1
3
1993/0
1/16 23:18:18
ceder Exp $"
;
static
char
*
rcsid
=
"$Id: session.c,v 0.1
4
1993/0
8/05 01:08:43
ceder Exp $"
;
#include
"rcs.h"
USE
(
rcsid
);
...
...
@@ -49,6 +49,7 @@ USE(rcsid);
#include
"config.h"
#include
"internal-connections.h"
#include
"tmp-difftime.h"
/*
* Create an oldstyle username, user%host.domain@host.domain.
...
...
@@ -660,3 +661,63 @@ enable (u_char ena_level)
active_connection
->
ena_level
=
ena_level
;
return
OK
;
}
extern
Success
set_client_version
(
const
String
client_name
,
const
String
client_version
)
{
if
(
s_strlen
(
client_name
)
>
CONF_NAME_LEN
||
s_strlen
(
client_version
)
>
CONF_NAME_LEN
)
{
kom_errno
=
KOM_LONG_STR
;
return
FAILURE
;
}
s_strcpy
(
&
active_connection
->
client_name
,
client_name
);
s_strcpy
(
&
active_connection
->
client_version
,
client_version
);
return
OK
;
}
extern
Success
get_client_name
(
Session_no
session_no
,
String
*
result
)
{
Connection
*
cptr
;
CHK_LOGIN
(
FAILURE
);
cptr
=
get_conn_by_number
(
session_no
);
if
(
cptr
!=
NULL
)
{
*
result
=
cptr
->
client_name
;
return
OK
;
}
else
{
kom_errno
=
KOM_UNDEF_SESSION
;
return
FAILURE
;
}
}
extern
Success
get_client_version
(
Session_no
session_no
,
String
*
result
)
{
Connection
*
cptr
;
CHK_LOGIN
(
FAILURE
);
cptr
=
get_conn_by_number
(
session_no
);
if
(
cptr
!=
NULL
)
{
*
result
=
cptr
->
client_version
;
return
OK
;
}
else
{
kom_errno
=
KOM_UNDEF_SESSION
;
return
FAILURE
;
}
}
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