Commit ee083b66 authored by David Byers's avatar David Byers
Browse files

All functions: check the connection's want_async array before sending messages

parent 358dfaa8
/*
* $Id: prot-a-send-async.c,v 0.12 1995/01/01 20:17:25 ceder Exp $
* $Id: prot-a-send-async.c,v 0.13 1996/06/14 15:54:43 byers Exp $
* Copyright (C) 1991, 1993, 1994, 1995 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -26,7 +26,7 @@
* Asynchronous messages in protocol A.
*/
static char *rcsid = "$Id: prot-a-send-async.c,v 0.12 1995/01/01 20:17:25 ceder Exp $";
static char *rcsid = "$Id: prot-a-send-async.c,v 0.13 1996/06/14 15:54:43 byers Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -49,6 +49,7 @@ USE(rcsid);
#include "mux.h"
#include "prot-a-output.h"
static void
async_header(Connection *fp,
int no_of_tokens,
......@@ -74,6 +75,7 @@ prot_a_async_new_text(Connection *cptr,
Text_no text_no,
Text_stat *text_s)
{
ASYNC_CHECK_ACCEPT(cptr, ay_new_text);
async_header(cptr, 16, ay_new_text);
mux_printf(cptr, " %lu", text_no);
prot_a_output_text_stat(cptr, text_s);
......@@ -85,6 +87,7 @@ void
prot_a_async_i_am_on(Connection *cptr,
Who_info info)
{
ASYNC_CHECK_ACCEPT(cptr, ay_i_am_on);
async_header(cptr, 5, ay_i_am_on);
prot_a_output_who_info(cptr, &info);
async_trailer(cptr);
......@@ -95,6 +98,7 @@ prot_a_async_logout(Connection *cptr,
Pers_no pers_no,
Session_no session_no)
{
ASYNC_CHECK_ACCEPT(cptr, ay_logout);
async_header(cptr, 2, ay_logout);
mux_printf(cptr, " %lu %lu", (unsigned long)pers_no,
(unsigned long)session_no);
......@@ -107,6 +111,7 @@ prot_a_async_new_name(Connection *cptr,
String old_name,
String new_name)
{
ASYNC_CHECK_ACCEPT(cptr, ay_new_name);
async_header(cptr, 3, ay_new_name);
mux_printf(cptr, " %lu", (unsigned long)conf_no);
prot_a_output_string(cptr, old_name);
......@@ -117,6 +122,7 @@ prot_a_async_new_name(Connection *cptr,
void
prot_a_async_sync_db(Connection *cptr)
{
ASYNC_CHECK_ACCEPT(cptr, ay_sync_db);
async_header(cptr, 0, ay_sync_db);
async_trailer(cptr);
}
......@@ -125,6 +131,7 @@ void
prot_a_async_forced_leave_conf(Connection *cptr,
Conf_no conf_no)
{
ASYNC_CHECK_ACCEPT(cptr, ay_leave_conf);
async_header(cptr, 1, ay_leave_conf);
mux_printf(cptr, " %lu", (unsigned long)conf_no);
async_trailer(cptr);
......@@ -135,6 +142,7 @@ prot_a_async_login(Connection *cptr,
Pers_no pers_no,
int session_no)
{
ASYNC_CHECK_ACCEPT(cptr, ay_login);
async_header(cptr, 2, ay_login);
mux_printf(cptr, " %lu %lu", (unsigned long)pers_no,
(unsigned long)session_no);
......@@ -144,6 +152,7 @@ prot_a_async_login(Connection *cptr,
void
prot_a_async_rejected_connection(Connection *cptr)
{
ASYNC_CHECK_ACCEPT(cptr, ay_rejected_connection);
async_header(cptr, 0, ay_rejected_connection);
async_trailer(cptr);
}
......@@ -154,6 +163,7 @@ prot_a_async_send_message(Connection *cptr,
Pers_no sender,
String message)
{
ASYNC_CHECK_ACCEPT(cptr, ay_send_message);
async_header(cptr, 3, ay_send_message);
mux_printf(cptr, " %lu %lu", (unsigned long)recipient,
(unsigned long)sender);
......
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