Commit 5de8b71f authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Include tmp-difftime.h.

(set_client_version, get_client_name, get_client_version): New functions.
parent d04212ac
/*
* $Id: session.c,v 0.13 1993/01/16 23:18:18 ceder Exp $
* $Id: session.c,v 0.14 1993/08/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.13 1993/01/16 23:18:18 ceder Exp $";
static char *rcsid = "$Id: session.c,v 0.14 1993/08/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;
}
}
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