Commit 2004279b authored by Per Cederqvist's avatar Per Cederqvist
Browse files

New bit in the Connection struct: username_valid.

parent efbb80c1
Mon May 18 23:27:04 1992 Per Cederqvist (ceder@lysator)
* connections.h (Connection): Added the boolean field
username_valid.
* internal-connections.c (new_client, EMPTY_CONNECTION):
Initialize it.
* prot-a.c (prot_a_parse_packet): Use it to test if username is
set or not (instead of just assuming that an empty username is
unset).
Thu Apr 16 00:46:50 1992 Per Cederqvist (ceder@lysator)
* Use isc-0.97:
......
/*
* $Id: connections.h,v 0.10 1992/04/10 11:56:32 ceder Exp $
* $Id: connections.h,v 0.11 1992/05/18 23:09:19 ceder Exp $
* Copyright (C) 1991 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -23,7 +23,7 @@
* Please mail bug reports to bug-lyskom@lysator.liu.se.
*/
/*
* $Id: connections.h,v 0.10 1992/04/10 11:56:32 ceder Exp $
* $Id: connections.h,v 0.11 1992/05/18 23:09:19 ceder Exp $
*
* connections.h -- The top level of the communication packet.
*
......@@ -44,7 +44,8 @@ typedef struct connection {
struct connection * prev;
struct connection * next;
/* The following are used by services.c */
/* The following are used by services.c (which has been split
into many files such as conference.c and person.c). */
Pers_no pers_no; /* 0 if not yet logged in. */
Person * person; /* NULL if not yet logged in. */
......@@ -53,10 +54,11 @@ typedef struct connection {
Conf_no cwc; /* Current working conference */
String what_am_i_doing;
u_char ena_level; /* Enable level */
String username; /* Userid and hostname. */
String username; /* Given userid. */
String hostname; /* Real hostname */
String ident_user; /* Real username */
Bool invisible; /* Is this session invisible? */
Bool username_valid; /* Set once username is set. */
/* The following are used by server/connections.c */
......
/*
* $Id: internal-connections.c,v 0.9 1992/04/10 11:56:34 ceder Exp $
* $Id: internal-connections.c,v 0.10 1992/05/18 23:09:21 ceder Exp $
* Copyright (C) 1991 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -28,7 +28,7 @@
* Abstract routines on the data type Connection.
*/
static char *rcsid = "$Id: internal-connections.c,v 0.9 1992/04/10 11:56:34 ceder Exp $";
static char *rcsid = "$Id: internal-connections.c,v 0.10 1992/05/18 23:09:21 ceder Exp $";
#include "exp.h"
......@@ -54,7 +54,7 @@ INTERNAL const Connection EMPTY_CONNECTION =
0, NULL, NO_TIME, 0,
EMPTY_STRING_i, 0,
EMPTY_STRING_i, EMPTY_STRING_i, EMPTY_STRING_i,
FALSE,
FALSE, FALSE,
/* Used by server/connections.c */
NULL, '\0',
0, 0, 0, 0, 0, 0, 0,
......@@ -118,6 +118,7 @@ new_client(void)
c->username = EMPTY_STRING;
c->ident_user = EMPTY_STRING;
c->invisible = FALSE;
c->username_valid = FALSE;
return c;
}
......
/*
* $Id: prot-a.c,v 0.14 1992/04/04 17:32:55 ceder Exp $
* $Id: prot-a.c,v 0.15 1992/05/18 23:09:23 ceder Exp $
* Copyright (C) 1991 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -26,7 +26,7 @@
* Protocol A.
*/
static char *rcsid = "$Id: prot-a.c,v 0.14 1992/04/04 17:32:55 ceder Exp $";
static char *rcsid = "$Id: prot-a.c,v 0.15 1992/05/18 23:09:23 ceder Exp $";
#include <stdio.h>
......@@ -329,7 +329,7 @@ prot_a_is_legal_fnc(Call_header fnc)
void
prot_a_parse_packet(Connection *client)
{
if ( s_empty(client->username) )
if ( client->username_valid == FALSE )
{
/* Connection not established yet */
......@@ -338,7 +338,8 @@ prot_a_parse_packet(Connection *client)
client->username = client->c_string0; /* Kludge to deal with */
client->c_string0 = EMPTY_STRING; /* "A5B" as first input. */
/* Protokoll B will not suffer from this... */
client->username_valid = TRUE;
mux_printf(client, "LysKOM\n");
mux_flush(client);
BUG(("[Client %d is logged on]\n", client->session_no));
......
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