6 * Copyright (C) 1987 by the Massachusetts Institute of Technology
9 * Revision 1.1 1987-06-02 20:07:10 wesommer
15 static char *rcsid_sms_scall_c = "$Header$";
19 #include "sms_private.h"
20 #include "sms_server.h"
25 extern void clist_delete(), do_auth(), do_shutdown();
29 * Welcome to the (finite state) machine (highest level).
35 if (OP_STATUS(cp->pending_op) == OP_CANCELLED) {
36 (void) sprintf(buf1, "Closed connection (now %d client%s)",
39 com_err(whoami, 0, buf1);
46 /* Start recieving next request */
47 initialize_operation(cp->pending_op, sms_start_recv,
48 (char *)&cp->args, NULL);
49 queue_operation(cp->con, CON_INPUT, cp->pending_op);
50 cp->action = CL_RECEIVE;
53 /* Data is here. Process it & start it heading back */
54 do_call(cp); /* This may block for a while. */
55 initialize_operation(cp->pending_op, sms_start_send,
56 (char *)&cp->reply, NULL);
57 queue_operation(cp->con, CON_OUTPUT, cp->pending_op);
80 cl->reply.sms_argc = 0;
81 cl->reply.sms_status = 0;
82 if (((pn = cl->args->sms_procno) < 0) ||
83 (pn > SMS_MAX_PROC)) {
84 com_err(whoami, 0, "procno out of range");
85 cl->reply.sms_status = SMS_UNKNOWN_PROC;
89 fprintf(stderr, "[#%d] %s(", cl->id, procnames[pn]);
90 for (i=0; i < cl->args->sms_argc; i++) {
91 if (i) fputc(',', stderr);
92 frequote(stderr,cl->args->sms_argv[i]);
94 fprintf(stderr, ")\n");
99 cl->reply.sms_status = 0;
100 com_err(whoami, 0, "noop");