-/* Gateway kernel
+/* Gateway kernel - Main
* Europagate, 1995
*
* $Log: main.c,v $
- * Revision 1.14 1995/03/28 11:42:34 adam
+ * Revision 1.15 1995/04/17 09:34:30 adam
+ * Timeout (idletime) adjustable. Minor changes in kernel.
+ *
+ * Revision 1.14 1995/03/28 11:42:34 adam
* First use of string-queue utility.
*
* Revision 1.13 1995/03/28 08:01:25 adam
fd_set set_r;
int r, gip_fd;
struct timeval tv;
+ int timeout;
+ int continuation = 0;
+ timeout = atoi(gw_res_get (info.kernel_res, "gw.timeout", "600"));
gw_log (GW_LOG_DEBUG, KERNEL_LOG, "kernel event loop");
sprintf (fifo_client_name, "fifo.c.%d", userid);
{
FD_ZERO (&set_r);
FD_SET (gip_fd, &set_r);
- tv.tv_sec = 60;
+ tv.tv_sec = timeout;
tv.tv_usec = 0;
gw_log (GW_LOG_DEBUG, KERNEL_LOG, "IPC select");
}
if (r == 0)
{
- gw_log (GW_LOG_STAT, KERNEL_LOG, "Timeout");
+ gw_log (GW_LOG_STAT, KERNEL_LOG, "Timeout after %d seconds",
+ timeout);
break;
}
if (FD_ISSET (gip_fd, &set_r))
gw_log (GW_LOG_DEBUG, KERNEL_LOG, "Incoming mail...\n");
while (lgets (line_buf, sizeof(line_buf)-1, gip_fd))
str_queue_enq (queue, line_buf);
- urp (queue);
+ urp_start (continuation, queue);
+ urp_command (queue);
+ urp_end ();
while (str_queue_deq (queue, 0, 0))
;
}
{
gw_log (GW_LOG_WARN, KERNEL_LOG, "Unknown IPC: %s", command);
}
+ continuation = 1;
}
}
gips_close (gip);
fprintf (stderr, "Options:\n");
fprintf (stderr, " -d Enable debugging log\n");
fprintf (stderr, " -t target Open target immediately\n");
- fprintf (stderr, " -l lang Set language\n");
+ fprintf (stderr, " -g lang Set language\n");
fprintf (stderr, " -o resource Override with resource\n");
fprintf (stderr, " -h host Override host\n");
fprintf (stderr, " -p port Override port\n");
- fprintf (stderr, " -g log Set Log file\n");
+ fprintf (stderr, " -l log Set Log file\n");
fprintf (stderr, " -i id Set IPC userid\n");
exit (1);
case 'd':
exit (1);
}
break;
- case 'l':
+ case 'g':
if (argv[0][2])
info.lang = argv[0]+2;
else if (argc > 0)
exit (1);
}
break;
- case 'g':
+ case 'l':
if (argv[0][2])
gw_log_file (GW_LOG_ALL, argv[0]+2);
else if (argc > 0)
char line_buf[512];
while (lgets (line_buf, sizeof(line_buf)-1, 0))
str_queue_enq (queue, line_buf);
- urp (queue);
+ urp_start (0, queue);
+ urp_command (queue);
+ urp_end ();
}
return 0;
}