X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=www%2Fwsh.c;h=f15ae8790cf63bf70c91b1575637ce0271c93000;hb=ce3ef5c24347417e973e9e6739466dfc701fe19d;hp=c6093f40ba58fd370f0e75415b23feb859d3b7a7;hpb=94e0e8ff10cdb5142f983cd76156310461f9eb89;p=egate.git diff --git a/www/wsh.c b/www/wsh.c index c6093f4..f15ae87 100644 --- a/www/wsh.c +++ b/www/wsh.c @@ -41,7 +41,12 @@ * USE OR PERFORMANCE OF THIS SOFTWARE. * * $Log: wsh.c,v $ - * Revision 1.7 1995/11/06 17:44:23 adam + * Revision 1.8 1995/12/20 16:31:33 adam + * Bug fix: shell might terminate even though new request was initiated + * by the cgi interface program. + * Work on more simple user interface and Europagate buttons. + * + * Revision 1.7 1995/11/06 17:44:23 adam * State reestablised when shell restarts. History of previous * result sets. * @@ -75,13 +80,12 @@ #include #include +#include #include "whtml.h" #include "wtcl.h" #include "wirtcl.h" -#define TIMEOUT_SHORT 60 -#define TIMEOUT_MEDIUM 1800 -#define TIMEOUT_LONG 7200 +#define TIMEOUT 60 static WCLIENT wcl; static char *mod = "wsh"; @@ -89,8 +93,9 @@ static char *mod = "wsh"; int main (int argc, char **argv) { char *script, *parms, parms_buf[512]; - int timeout = TIMEOUT_SHORT; + int timeout; W_Interp w_interp; + GW_DB gw_db; chdir("/usr/local/etc/httpd/cgi-bin"); gw_log_init (*argv); @@ -117,10 +122,23 @@ int main (int argc, char **argv) exit (1); } w_interp_load_state (w_interp, NULL); - while (wproto_process(wcl, timeout) > 0) + timeout = TIMEOUT; + while (1) { char *p; + int r; + r = wproto_process (wcl, timeout); + if (r <= 0) + { + gw_db = gw_db_open ("www.db", 0, 0); + if (gw_db) + break; + gw_log (GW_LOG_DEBUG, mod, "Cannot terminate - new request"); + timeout = 10; + continue; + } + timeout = TIMEOUT; wo_clear (wcl, "text/html"); strcpy (parms_buf, wcl->wf_parms); script = parms = parms_buf;