$Log$
+ Revision 573.64 2001/01/13 06:12:15 ajc
+ * Added the ASYN command
+
Revision 573.63 2001/01/12 22:05:46 ajc
* Fixed a bug that caused bogus wholist lines to be displayed when a non-aide
reads a list containing stealth mode sessions.
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
+
ScheduledShutdown = new_state;
}
cprintf("%d %d\n", OK, ScheduledShutdown);
+}
+
+
+/*
+ * Set or unset asynchronous protocol mode
+ */
+void cmd_asyn(char *argbuf)
+{
+ int new_state;
+
+ new_state = extract_int(argbuf, 0);
+ if ((new_state == 0) || (new_state == 1)) {
+ CC->is_async = new_state;
}
+ cprintf("%d %d\n", OK, CC->is_async);
+}
/*
CC->kill_me = 1;
}
+ else if (!strncasecmp(cmdbuf,"ASYN",4)) {
+ cmd_asyn(&cmdbuf[5]);
+ }
+
else if (!strncasecmp(cmdbuf,"LOUT",4)) {
if (CC->logged_in) logout(CC);
cprintf("%d logged out.\n",OK);
char lastcmdname[5]; /* name of last command executed */
unsigned cs_flags; /* miscellaneous flags */
void (*h_command_function) (void) ; /* service command function */
+ int is_async; /* Nonzero if client accepts async msgs */
/* feeping creaturisms... */
int cs_clientdev; /* client developer ID */
char cs_host[26]; /* host logged in from */
/* Beginning of cryptography - session nonce */
- char cs_nonce[NONCE_SIZE]; /* The nonce for this session's next auth transaction */
+ char cs_nonce[NONCE_SIZE]; /* The nonce for this session's next auth transaction */
FILE *download_fp; /* Fields relating to file transfer */
FILE *upload_fp;
int disable_exp; /* Set to 1 to disable incoming pages */
/* Masquerade... */
- char fake_username[USERNAME_SIZE]; /* Fake username <bc> */
- char fake_postname[USERNAME_SIZE]; /* Fake postname <bc> */
- char fake_hostname[25]; /* Name of the fake hostname <bc> */
- char fake_roomname[ROOMNAMELEN]; /* Name of the fake room <bc> */
-
+ char fake_username[USERNAME_SIZE]; /* Fake username <bc> */
+ char fake_postname[USERNAME_SIZE]; /* Fake postname <bc> */
+ char fake_hostname[25]; /* Fake hostname <bc> */
+ char fake_roomname[ROOMNAMELEN]; /* Fake roomname <bc> */
/* Dynamically allocated session data */
struct CtdlSessData *FirstSessData;
#define EVT_CMD 6 /* Called after each server command */
#define EVT_RWHO 7 /* An RWHO command is being executed */
-
#define EVT_TIMER 50 /* Timer events are called once per minute
and are not tied to any session */
#define EVT_PURGEUSER 100 /* Deleting a user */
#define EVT_OUTPUTMSG 101 /* Outputting a message */
-
/*
* MessageFunctionHook extensions are used for hooks which implement handlers
* for various types of message operations (save, read, etc.)
should begin sending a listing of some sort. The client *must* send something,
even if it is an empty listing. Again, the listing ends with "000" on a line
by itself.
-
+ BINARY_FOLLOWS and SEND_BINARY mean that the client must immediately send
+or receive a block of binary data. The first parameter will always be the
+number of bytes.
+ ASYNC_MESSAGE_FOLLOWS means that an asynchronous, or unsolicited, message
+follows. The next line will be one of the above codes, and if a data transfer
+is involved it must be handled immediately. Note that the client will not
+receive this type of response unless it indicates to the server that it is
+capable of handling them; see the writeup of the ASYN command later in this
+document.
PARAMETERIZATION
----------------
minutes) for well-behaved clients to voluntarily terminate, and then issue a
TERM command to forcibly disconnect the client (or perhaps a DOWN command, if
you are logging off users for the purpose of shutting down the server).
-
+
+
+ ASYN (ASYNchronous message support)
+
+ Negotiate the use of asynchronous, or unsolicited, protocol messages. The
+only parameter specified should be 1 or 0 to indicate that the client can or
+cannot handle this type of messages. The server will reply OK followed by a
+1 or 0 to tell the client which mode it is now operating in.
+
+ If the command is not available on the server (i.e. it returns ERROR), or
+if the command has not been executed by the client, it should be assumed that
+this mode of operation is NOT in effect.
+
+ The client may also send any value other than 0 or 1 to simply cause the
+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.