* temporary implementation of 901 asynchronous express messages
authorArt Cancro <ajc@citadel.org>
Mon, 15 Jan 2001 16:30:31 +0000 (16:30 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 15 Jan 2001 16:30:31 +0000 (16:30 +0000)
citadel/ChangeLog
citadel/ipcdef.h
citadel/serv_chat.c
citadel/techdoc/session.txt

index 9145789b0e7a065763a0638eb5ba68c334607107..5e36d394424b737057f9c9638983988a1cd26d19 100644 (file)
@@ -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 <L>ong
 
@@ -2318,3 +2321,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
+
index e139b49fdf8a592e0c6e4245f7bac9d089f5f1c1..487808d5c3c276a702e73fe31dfc1f1ad3707033 100644 (file)
@@ -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];
index 08a450b48820126a600660a466bb26331c1b8b21..edff3d93a18c0f7d018301febe55680839750fc6 100644 (file)
@@ -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$";
index 8a5d1eb6aa5dc33fa94f64bec3f2531a6e13934c..e7f2344812c03d13514ba555f3b17000a32efdcc 100644 (file)
@@ -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).