* Europagate, 1995
*
* $Log: main.c,v $
- * Revision 1.21 1995/05/01 16:26:56 adam
+ * Revision 1.22 1995/05/03 07:37:39 adam
+ * CCL commands stop/continue implemented. New functions gw_res_{int,bool}
+ * are used when possible.
+ *
+ * Revision 1.21 1995/05/01 16:26:56 adam
* More work on resource monitor.
*
* Revision 1.20 1995/05/01 12:43:32 adam
int timeout;
int continuation = 0;
int extra_fd;
+ int persist_flag;
- timeout = atoi(gw_res_get (info.kernel_res, "gw.timeout", "600"));
+ persist_flag = gw_res_bool (info.kernel_res, "gw.persist", 0);
+ timeout = gw_res_int (info.kernel_res, "gw.timeout", 600);
gw_log (GW_LOG_DEBUG, KERNEL_LOG, "event loop");
sprintf (fifo_client_name, "fifo.c.%d", userid);
{
gw_log (GW_LOG_STAT, KERNEL_LOG, "Timeout after %d seconds",
timeout);
- if (info.zass)
+ if (info.zass && persist_flag)
save_p_state (userid);
break;
}
while (lgets (line_buf, sizeof(line_buf)-1, gip_fd))
str_queue_enq (queue, line_buf);
urp_start (continuation, queue);
- if (!continuation)
+ if (persist_flag && !continuation)
load_p_state (userid);
- urp_command (queue);
+ r = urp_command (queue);
+ if (persist_flag && r == 1)
+ del_p_state (userid);
urp_end ();
while (str_queue_deq (queue, 0, 0))
;
else
{
strcpy (info.hostname, info.target);
- info.port = atoi (gw_res_get
- (info.kernel_res, "gw.portno", "210"));
+ info.port = gw_res_int (info.kernel_res, "gw.portno", 210);
}
}
else
strncpy (info.hostname, gw_res_get (info.kernel_res,
"gw.hostname", "localhost"),
sizeof(info.hostname)-1);
- info.port = atoi (gw_res_get (info.kernel_res,
- "gw.portno", "210"));
+ info.port = gw_res_int (info.kernel_res, "gw.portno", 210);
strcpy (info.account, gw_res_get (info.kernel_res, "gw.account", ""));
}
if (info.databases)
if (info.override_hostname)
strncpy (info.hostname, info.override_hostname,
sizeof(info.hostname)-1);
- v = gw_res_get (info.kernel_res, "gw.result.set", NULL);
- info.setno = v ? -1 : 0;
+ if (gw_res_bool (info.kernel_res, "gw.result.set", 1))
+ info.setno = 0;
+ else
+ info.setno = -1;
#if USE_FML
if (!info.fml)
{