From: Art Cancro Date: Mon, 15 Jan 2001 16:30:31 +0000 (+0000) Subject: * temporary implementation of 901 asynchronous express messages X-Git-Tag: v7.86~6989 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=fde54a5c172749c0ffb4501a053d8cbd88a42ea2;p=citadel.git * temporary implementation of 901 asynchronous express messages --- diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 9145789b0..5e36d3944 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,7 @@ $Log$ + Revision 573.67 2001/01/15 16:30:31 ajc + * temporary implementation of 901 asynchronous express messages + Revision 573.66 2001/01/14 14:55:39 ajc * Changed the format of <.W>holist ong @@ -2318,3 +2321,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import + diff --git a/citadel/ipcdef.h b/citadel/ipcdef.h index e139b49fd..487808d5c 100644 --- a/citadel/ipcdef.h +++ b/citadel/ipcdef.h @@ -28,6 +28,9 @@ #define NO_SUCH_SYSTEM 73 #define ALREADY_EXISTS 74 +#define ASYNC_MSG 900 +#define ASYNC_GEXP 01 + struct CtdlServInfo { int serv_pid; char serv_nodename[32]; diff --git a/citadel/serv_chat.c b/citadel/serv_chat.c index 08a450b48..edff3d93a 100644 --- a/citadel/serv_chat.c +++ b/citadel/serv_chat.c @@ -449,6 +449,20 @@ void cmd_gexp(char *argbuf) { phree(ptr); } +/* + * Asynchronously deliver express messages' + */ +void cmd_gexp_async(void) { + + /* Only do this if the session can handle asynchronous protocol */ + if (CC->is_async == 0) return; + + /* And don't do it if there's nothing to send. */ + if (CC->FirstExpressMessage == NULL) return; + + cprintf("%d express msg\n", ASYNC_MSG + ASYNC_GEXP); + cmd_gexp(""); +} /* * Back end support function for send_express_message() and company @@ -723,6 +737,7 @@ char *Dynamic_Module_Init(void) CtdlRegisterProtoHook(cmd_sexp, "SEXP", "Send an express message"); CtdlRegisterProtoHook(cmd_dexp, "DEXP", "Disable express messages"); CtdlRegisterProtoHook(cmd_reqt, "REQT", "Request client termination"); + CtdlRegisterSessionHook(cmd_gexp_async, EVT_CMD); CtdlRegisterSessionHook(delete_express_messages, EVT_STOP); CtdlRegisterXmsgHook(send_express_message, XMSG_PRI_LOCAL); return "$Id$"; diff --git a/citadel/techdoc/session.txt b/citadel/techdoc/session.txt index 8a5d1eb6a..e7f234481 100644 --- a/citadel/techdoc/session.txt +++ b/citadel/techdoc/session.txt @@ -1837,3 +1837,21 @@ server to output its current state without changing it. When asynchronous protocol mode is in effect, the client MUST handle any asynchronous messages as they arrive, before doing anything else. + + + + + ASYNCHRONOUS MESSAGES + --------------------- + + When the client protocol is operating in asynchronous mode (please refer to +the writeup of the ASYN command above), the following messages may arrive at +any time: + + + 901 (express message arriving) + + There is an express message intended for this client. When the client +receives this message, it MUST act as if it just sent a GEXP command (the data +following the 901 message WILL be a LISTING_FOLLOWS data transfer; in fact, +the current implementation simply executes a GEXP command internally).