X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=www%2Fwsh.c;h=b08bb695d5d5c610fbdca41bf7159ff3f1038574;hb=5b5e33eaf7afda11d555540e3f15ac2d49d245a6;hp=dc9a251d4fd1015fe7e4296bfb8841454d2c7485;hpb=129b920a3019c8cfcb8ed37b20b1b49fd557b100;p=egate.git diff --git a/www/wsh.c b/www/wsh.c index dc9a251..b08bb69 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.9 1996/01/09 10:46:51 adam + * 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]. + * + * Revision 1.9 1996/01/09 10:46:51 adam * New defines: LOGDIR/EGWDIR/CGIDIR set in Makefile. * * Revision 1.8 1995/12/20 16:31:33 adam @@ -142,7 +147,7 @@ int main (int argc, char **argv) continue; } timeout = TIMEOUT; - wo_clear (wcl, "text/html"); + wo_clear (wcl, NULL); strcpy (parms_buf, wcl->wf_parms); script = parms = parms_buf; while (*parms && *parms != '/') @@ -151,8 +156,8 @@ int main (int argc, char **argv) *parms++ = '\0'; if (*script) { - p = script + strlen(script) - 1; - while (*p && p != script) + p = script + strlen(script); + while (*--p && p != script) switch (*p) { case '+': @@ -171,10 +176,14 @@ int main (int argc, char **argv) wproto_cache (wcl, atoi(p+1)); *p = '\0'; break; - default: - --p; + case ';': + wo_printf (wcl, "Expires: %s\n", p[1] ? p+1 : "0"); + gw_log (GW_LOG_DEBUG, mod, "Expires: %s", p[1] ?p+1:"0"); + *p = '\0'; + break; } } + wo_printf (wcl, "Content-type: text/html\n\n"); for (p = parms; *p; p++) if (*p == '+') *p = ' ';