Commit 78a4bb3c authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(async_new_text_old): Use handshake_ok() to check if it is OK to send

	the message to the client.  As a result, the message will not
	be sent until the DNS lookup has completed.
(async_new_text): Ditto.
(async_i_am_on): Ditto.
(async_logout): Ditto.
(async_new_name): Ditto.
(async_forced_leave_conf): Ditto.
(async_login): Ditto.
(async_deleted_text): Ditto.
(async_new_recipient): Ditto.
(async_sub_recipient): Ditto.
(async_new_membership): Ditto.
(async_new_user_area): Ditto.
(async_garb_ended): Ditto.
(async_sync_db): Ditto, but ignore the DNS lookup.
(async_rejected_connection): Ditto.
parent d710fb15
/*
* $Id: send-async.c,v 0.43 2003/07/12 22:26:35 ceder Exp $
* $Id: send-async.c,v 0.44 2003/08/05 09:50:53 ceder Exp $
* Copyright (C) 1991, 1993-2002 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -70,7 +70,7 @@ async_new_text_old(struct connection *cptr,
case 0:
break;
case 'A':
if (cptr->username_valid == TRUE)
if (handshake_ok(cptr, 0))
prot_a_async_new_text_old(cptr, text_no, text_s);
break;
default:
......@@ -93,7 +93,7 @@ async_new_text(struct connection *cptr,
case 0:
break;
case 'A':
if (cptr->username_valid == TRUE)
if (handshake_ok(cptr, 0))
prot_a_async_new_text(cptr, text_no, text_s);
break;
default:
......@@ -128,7 +128,7 @@ async_i_am_on(Who_info info)
case 0: /* Not yet logged on. */
break;
case 'A':
if (cptr->username_valid == TRUE)
if (handshake_ok(cptr, 0))
prot_a_async_i_am_on(cptr, filtered);
break;
default:
......@@ -163,7 +163,7 @@ async_logout(Pers_no pers_no,
case 0:
break;
case 'A':
if (cptr->username_valid == TRUE)
if (handshake_ok(cptr, 0))
prot_a_async_logout(cptr, pers_no, session_no);
break;
default:
......@@ -203,10 +203,10 @@ async_new_name(Conf_no conf_no,
case 'A':
/* Check that cptr has enough privileges to know
anything about the conference. */
if (cptr->username_valid == TRUE &&
(access_perm(conf_no, cptr, read_protected) > none ||
ENA_C(cptr, admin, 2) || /* OK -- Uses ENA_C */
ENA_C(cptr, wheel, 8))) /* OK -- Uses ENA_C */
if (handshake_ok(cptr, 0)
&& (access_perm(conf_no, cptr, read_protected) > none
|| ENA_C(cptr, admin, 2) /* OK -- Uses ENA_C */
|| ENA_C(cptr, wheel, 8))) /* OK -- Uses ENA_C */
{
prot_a_async_new_name(cptr, conf_no, old_name, new_name);
}
......@@ -251,7 +251,7 @@ async_sync_db(void)
case 0:
break;
case 'A':
if (cptr->username_valid == TRUE)
if (handshake_ok(cptr, ignore_dns))
prot_a_async_sync_db(cptr);
break;
default:
......@@ -274,7 +274,7 @@ async_forced_leave_conf (struct connection *cptr,
case 0:
break;
case 'A':
if (cptr->username_valid == TRUE)
if (handshake_ok(cptr, 0))
prot_a_async_forced_leave_conf(cptr, conf_no);
break;
default:
......@@ -308,7 +308,7 @@ async_login(Pers_no pers_no,
case 0:
break;
case 'A':
if (cptr->username_valid == TRUE)
if (handshake_ok(cptr, 0))
prot_a_async_login(cptr, pers_no, client_no);
break;
......@@ -352,7 +352,7 @@ async_rejected_connection(void)
case 0:
break;
case 'A':
if (cptr->username_valid == TRUE)
if (handshake_ok(cptr, ignore_dns))
prot_a_async_rejected_connection(cptr);
break;
......@@ -418,9 +418,9 @@ async_send_group_message(Pers_no recipient,
case 0:
break;
case 'A':
if ((recipient == 0 ||
(recipient == cptr->pers_no && recipient != 0 ))
&& cptr->username_valid == TRUE)
if ((recipient == 0
|| (recipient == cptr->pers_no && recipient != 0 ))
&& handshake_ok(cptr, ignore_dns))
{
if (force_message)
{
......@@ -458,7 +458,7 @@ async_deleted_text(struct connection *cptr,
case 0:
break;
case 'A':
if (cptr->username_valid == TRUE)
if (handshake_ok(cptr, 0))
prot_a_async_deleted_text(cptr, text_no, text_s);
break;
default:
......@@ -482,7 +482,7 @@ async_new_recipient(struct connection *cptr,
case 0:
break;
case 'A':
if (cptr->username_valid == TRUE)
if (handshake_ok(cptr, 0))
prot_a_async_new_recipient(cptr, text_no, conf_no, type);
break;
default:
......@@ -506,7 +506,7 @@ async_sub_recipient(struct connection *cptr,
case 0:
break;
case 'A':
if (cptr->username_valid == TRUE)
if (handshake_ok(cptr, 0))
prot_a_async_sub_recipient(cptr, text_no, conf_no, type);
break;
default:
......@@ -529,7 +529,7 @@ async_new_membership(struct connection *cptr,
case 0:
break;
case 'A':
if (cptr->username_valid == TRUE)
if (handshake_ok(cptr, 0))
prot_a_async_new_membership(cptr, pers_no, conf_no);
break;
default:
......@@ -562,7 +562,7 @@ async_new_user_area(Pers_no person,
/* Check that connection is logged on and allowed to see
the user-area of PERSON. Check the want_async here
to avoid the potentially expensive call to access_perm. */
if (cptr->username_valid == TRUE
if (handshake_ok(cptr, 0)
&& cptr->want_async[ay_new_user_area] == TRUE
&& access_perm(person, cptr, unlimited) == unlimited)
{
......@@ -599,7 +599,7 @@ async_garb_ended(int no_deleted)
break;
case 'A':
/* Check that connection is logged on. */
if (cptr->username_valid == TRUE)
if (handshake_ok(cptr, 0))
prot_a_async_garb_ended(cptr, no_deleted);
break;
default:
......
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