# Email gateway - general kernel resources
-# $Id: default.res,v 1.21 1995/05/16 09:40:41 adam Exp $
+# $Id: default.res,v 1.22 1995/05/17 10:51:32 adam Exp $
#
# Important directories, programs, etc.
gw.reply.mta: /usr/lib/sendmail
gw.reply.tmp.dir: /tmp
#gw.path: /home/adam/egate/kernel
gw.marc.log: marc.log
-gw.timeout: 20
+gw.timeout: 5
gw.resultset: 1
gw.persist: 1
-gw.max.process: 2
+gw.max.process: 3
# Retrieval settings
gw.ignore.which: 1
# Email gateway - resources for english conversation
-# $Id: lang.uk.res,v 1.7 1995/05/04 10:40:07 adam Exp $
+# $Id: lang.uk.res,v 1.8 1995/05/17 10:51:32 adam Exp $
#
# Messages
gw.msg.subject: Your Z39.50 Query
gw.msg.records: %d records found in set %s
# Error messages
+gw.err.bad.show: Syntax error in show. Integer expected
+gw.err.pos.show: Start position greater than end position
gw.err.search.fail: Search fail. Connection closed
gw.err.no.database: You must choose database before issuing a find-query
gw.err.no.target: No connection established - command ignored
* Europagate, 1995
*
* $Log: monitor.c,v $
- * Revision 1.8 1995/05/16 09:40:42 adam
+ * Revision 1.9 1995/05/17 10:51:32 adam
+ * Added a few more error checks to the show command.
+ *
+ * Revision 1.8 1995/05/16 09:40:42 adam
* LICENSE. Setting of CCL token names (and/or/not/set) in read_kernel_res.
*
* Revision 1.7 1995/05/03 12:18:46 adam
for (ki = ke_info_list; ki; ki = ki->next)
if (ki->pid == pid)
ki->pid = -1;
- --no_process;
+/* --no_process;*/
}
signal (SIGCHLD, catch_child);
}
static void monitor_events (int argc, char **argv)
{
GIP gip_m;
- int r, gip_m_fd;
+ int r, gip_m_fd, too_many;
char line_buf[1024];
fd_set set_r;
char command[128], *cp;
exit (0);
}
/* deliver any unsent messages to Email kernels */
+ too_many = 0;
for (ki = ke_info_list; ki; ki = ki->next)
{
if (!ki->queue)
++no_process;
if (r == 1 || r == 2) /* transfer at all? */
str_queue_rm (&ki->queue);
+ if (r == 0) /* too many pending? */
+ too_many++;
+ }
+#if 0
+ if (too_many)
+ {
+ gw_log (GW_LOG_DEBUG, module, "%d too many pending",
+ too_many);
+ for (ki = ke_info_list; ki; ki = ki->next)
+ {
+ if (!ki->queue && ki->pid != -1)
+ {
+ if (!(ki->queue = str_queue_mk ()))
+ {
+ gw_log (GW_LOG_FATAL|GW_LOG_ERRNO, module,
+ "str_queue_mk");
+ exit (1);
+ }
+ str_queue_enq (ki->queue, "stop\n");
+ str_queue_enq (ki->queue, "\001");
+ gw_log (GW_LOG_DEBUG, module, "Stopping %d", ki->id);
+ deliver (argc, argv, ki->id, ki->queue, &ki->gip,
+ &ki->pid, 1);
+ str_queue_rm (&ki->queue);
+ break;
+ }
+ }
}
+#endif
FD_ZERO (&set_r);
FD_SET (gip_m_fd, &set_r);
gw_log (GW_LOG_DEBUG, module, "set gip_m_fd %d", gip_m_fd);
gipc_close (ki->gip);
gipc_destroy (ki->gip);
ki->gip = NULL;
+ --no_process;
}
else if ((fd = gip_infileno (ki->gip)) != -1)
{ /* read select on child FIFO */
gipc_close (ki->gip);
gipc_destroy (ki->gip);
ki->gip = NULL;
+ --no_process;
}
}
}
signal (SIGHUP, catch_hup);
signal (SIGTERM, catch_term);
signal (SIGINT, catch_int);
-#if 0
+#if 1
gw_log_file (GW_LOG_ALL, "monitor.log");
#endif
monitor_events (argc, argv);
* Europagate, 1995
*
* $Log: urp.c,v $
- * Revision 1.35 1995/05/16 09:40:43 adam
+ * Revision 1.36 1995/05/17 10:51:33 adam
+ * Added a few more error checks to the show command.
+ *
+ * Revision 1.35 1995/05/16 09:40:43 adam
* LICENSE. Setting of CCL token names (and/or/not/set) in read_kernel_res.
*
* Revision 1.34 1995/05/04 10:40:08 adam
li = li->next;
}
else
+ {
+ int len = li->len;
+ memcpy (tmp_str, li->name, len);
+ tmp_str[len] = '\0';
+ if (atoi(tmp_str) <= 0)
+ {
+ fprintf (reply_fd, "%s\n",
+ gw_res_get (info.kernel_res, "gw.err.bad.show",
+ "Integer expected"));
+ return -3;
+ }
li = li->next;
+ }
}
if (set_token)
gw_log (GW_LOG_DEBUG, KERNEL_LOG, "Got set=%.*s", set_token->len,
memcpy (tmp_str, li->name, len);
tmp_str [len] = '\0';
number = atoi (tmp_str) - offset + 1;
+ if (number <= 0)
+ {
+ fprintf (reply_fd, "%s\n",
+ gw_res_get (info.kernel_res,
+ "gw.err.pos.show",
+ "Starting position "
+ "greater than ending position"));
+ return -3;
+ }
}
else
{
}
li = li->next;
}
- else
+ else if (li->kind == CCL_TOK_TERM)
{
len = li->len;
memcpy (tmp_str, li->name, len);
mta = gw_res_get (info.kernel_res, "gw.reply.mta",
"/usr/lib/sendmail");
sprintf (cmd, "%s %s < %s", mta, info.from_str, info.reply_fname);
-
+#if 1
mta_code = system (cmd);
if (mta_code)
gw_log (GW_LOG_FATAL, KERNEL_LOG,
"Reply '%s' got exit code %d", cmd, mta_code);
else
unlink (info.reply_fname);
+#endif
gw_log (GW_LOG_ACCT, KERNEL_LOG, "User end %s", info.from_str);
}
}