X-Git-Url: http://git.indexdata.com/?p=egate.git;a=blobdiff_plain;f=www%2Fwsh.c;h=55eb3d8f0f7d35bcb9955c521b36235666d6deb8;hp=b08bb695d5d5c610fbdca41bf7159ff3f1038574;hb=c38544a87dfb550dfe4731c450bbde093c095bde;hpb=53a28f8f2ab30977f9ee2edffe5809fae61d5a4e diff --git a/www/wsh.c b/www/wsh.c index b08bb69..55eb3d8 100644 --- a/www/wsh.c +++ b/www/wsh.c @@ -41,7 +41,13 @@ * USE OR PERFORMANCE OF THIS SOFTWARE. * * $Log: wsh.c,v $ - * Revision 1.10 1996/01/12 10:05:22 adam + * Revision 1.12 1996/02/19 15:45:00 adam + * Sort of targets in multiple-targets selection. + * + * Revision 1.11 1996/02/12 10:10:32 adam + * Resource/config system used by the gateway. + * + * Revision 1.10 1996/01/12 10:05:22 adam * If script name ends with ';' HTTP/GET/Expires will be defined. * The cgi interface only reads final handshake if response from * server (shell) was zero-terminated [If it isn't it probably died]. @@ -88,13 +94,15 @@ #include #include +#include +#include + #include +#include #include "whtml.h" #include "wtcl.h" #include "wirtcl.h" -#define TIMEOUT 60 - static WCLIENT wcl; static char *mod = "wsh"; @@ -104,14 +112,30 @@ int main (int argc, char **argv) int timeout; W_Interp w_interp; GW_DB gw_db; + GwRes shRes; +#if 0 + struct rlimit rlim; + + rlim.rlim_cur = RLIM_INFINITY; + rlim.rlim_max = RLIM_INFINITY; + setrlimit (RLIMIT_CORE, &rlim); +#endif - chdir (EGWDIR); gw_log_init (*argv); - gw_log_file (GW_LOG_ALL, LOGDIR "/egwsh_log"); + gw_log_file (GW_LOG_ALL, "egwsh_log"); +#if 0 gw_log_level (GW_LOG_ALL); +#endif gw_log (GW_LOG_STAT, mod, "Europagate www shell: %s", *argv); - - if (!(wcl = wproto_init())) + shRes = gw_res_init (); + gw_res_merge (shRes, "egw.res"); + gw_res_merge (shRes, "shell.res"); + +#if 1 + gw_log_level (gw_log_mask_str ( + gw_res_get (shRes, "log.level", "default"))); +#endif + if (!(wcl = wproto_init (gw_res_get (shRes, "fifo.dir", "/tmp/egw")))) { gw_log (GW_LOG_FATAL, mod, "init"); exit(1); @@ -130,7 +154,9 @@ int main (int argc, char **argv) exit (1); } w_interp_load_state (w_interp, NULL); - timeout = TIMEOUT; + timeout = atoi (gw_res_get (shRes, "timeout", "120")); + if (timeout < 1) + timeout = 1; while (1) { char *p; @@ -146,7 +172,9 @@ int main (int argc, char **argv) timeout = 10; continue; } - timeout = TIMEOUT; + timeout = atoi (gw_res_get (shRes, "timeout", "120")); + if (timeout < 1) + timeout = 1; wo_clear (wcl, NULL); strcpy (parms_buf, wcl->wf_parms); script = parms = parms_buf; @@ -187,8 +215,8 @@ int main (int argc, char **argv) for (p = parms; *p; p++) if (*p == '+') *p = ' '; - gw_log (GW_LOG_DEBUG, mod, "script: %s", script); - gw_log (GW_LOG_DEBUG, mod, "parms: %s", parms); + gw_log (GW_LOG_STAT, mod, "script: %s", script); + gw_log (GW_LOG_STAT, mod, "parms: %s", parms); if (w_interp_exec (w_interp, script, parms)) { wo_printf (wcl, "wsh error\n");