From: Adam Dickmeiss Date: Wed, 20 Dec 1995 16:31:30 +0000 (+0000) Subject: Bug fix: shell might terminate even though new request was initiated X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=c6ea088406ba64e6ed5ea833e1c2ae516552e18e;p=egate.git 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. --- diff --git a/www/Makefile b/www/Makefile index 5d2bc73..a568940 100644 --- a/www/Makefile +++ b/www/Makefile @@ -2,7 +2,12 @@ # Europagate, 1995 # # $Log: Makefile,v $ -# Revision 1.17 1995/11/14 16:31:35 adam +# Revision 1.18 1995/12/20 16:31:30 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.17 1995/11/14 16:31:35 adam # Temporary remove of ccl entry. # # Revision 1.16 1995/11/14 16:01:50 adam @@ -78,7 +83,6 @@ WSCRIPTS=egwscript targets.egw query.egw search.egw showfull.egw z39util.tcl \ mtargets.egw mquery.egw msearch.egw HSCRIPTS=egwindex.html CONFFILES=ztargets.conf -GIFFILES=webgate.gif darrw.gif uarrw.gif noway.gif TPROG1=egwcgi TPROG2=egwsh TPROG3=wtest @@ -134,7 +138,7 @@ install.script: echo Installing $$x; \ cp $$x $(CONFDIR); \ done - @for x in $(GIFFILES); do \ + @for x in gif/*.gif; do \ echo Installing $$x; \ cp $$x $(GIFDIR); \ done diff --git a/www/query.egw b/www/query.egw index 79ad442..e922e29 100644 --- a/www/query.egw +++ b/www/query.egw @@ -4,7 +4,7 @@ { -# $Id: query.egw,v 1.18 1995/11/14 16:31:36 adam Exp $ +# $Id: query.egw,v 1.19 1995/12/20 16:31:31 adam Exp $ if {[info commands saveState] == ""} { source z39util.tcl @@ -41,7 +41,8 @@ proc ok-response {} { ir z39 } - html "

Search in " [lindex $targets($host) 0] "

\n" + html {

} + html " Search in " [lindex $targets($host) 0] "

\n" z39 callback ok-response z39 failback fail-response @@ -126,10 +127,9 @@ proc ok-response {} { html { All
} \n } + html "Input your search criteria:
\n" } } -
-

Input your search criteria:


{ set fields [lindex $targets($host) 2] for {set no 1} {$no < 4} {incr no} { @@ -164,18 +164,11 @@ proc ok-response {} { } } -{ - if {0} { - html {

Alternatively you can enter your query in } - html { CCL here:
} - html {
} - html "


\n" - } -} -

Various technical parameters:


+
{ - html {Max hits: } } -Records are shown in: -

+ +{ + html {} + html {} +} +


This page is maintained by Peter Wad Hansen . Last modified 29. september 1995.
This and the following pages are under construction and will continue to be so until the end of December 1995. -
{ - html { New target } -} -{ html "
\n" html "

Debug information

\n" html "sessionId: $sessionId
\n" diff --git a/www/search.egw b/www/search.egw index a249f6c..c25bfb9 100644 --- a/www/search.egw +++ b/www/search.egw @@ -1,13 +1,14 @@ { -# $Id: search.egw,v 1.17 1995/11/14 16:01:51 adam Exp $ +# $Id: search.egw,v 1.18 1995/12/20 16:31:31 adam Exp $ proc buttons {setNo setMax startPos after} { global sessionId + global useIcons global env global hist - if {$after && $setMax < [z39.$setNo resultCount]} { + if {!$useIcons && $after && $setMax < [z39.$setNo resultCount]} { html "

\n" html "

\n" html {\n" + if {$useIcons} { + html {} + } if {$setMax < [z39.$setNo resultCount]} { html {Next records} " | \n" + if {$useIcons} { + html {">} + } else { + html {">Next records} " | \n" + } } if {$startPos != "" && $startPos != "1"} { html {Previous records} " | \n" + if {$useIcons} { + html {">} + } else { + html {">Previous records} " | \n" + } } html {New query} " | \n" + if {$useIcons} { + html {">} + } else { + html {">New query} " | \n" + } html {New target} "

\n" - - if {!$after && $startPos != "" && $startPos != "1"} { + html / $sessionId {/targets.egw} + if {$useIcons} { + html {">} + } else { + html {">New target} + } + html "

\n" + if {!$useIcons && !$after && $startPos != "" && $startPos != "1"} { html "

\n" html { { -# $Id: showfull.egw,v 1.11 1995/11/14 09:30:20 adam Exp $ +# $Id: showfull.egw,v 1.12 1995/12/20 16:31:32 adam Exp $ proc buttons {setNo tno no format count host after} { global sessionId + global useIcons global env global hist html "

\n" - if {$after && $no < $count} { + if {!$useIcons && $after && $no < $count} { html "

\n" html {} html "

\n" } + if {$useIcons} { + html {} + } if {$no < $count} { html {Next record} " | \n" + if {$useIcons} { + html {">} + } else { + html {">Next record} " | \n" + } } if {$no > 1} { html {Previous record} " | \n" + if {$useIcons} { + html {">} + } else { + html {">Previous record} " | \n" + } } html {Raw format} " | \n" + html raw + if {$useIcons} { + html {">} + } else { + html {">Raw format} " | \n" + } } else { - html full {">Full format} " | \n" + html full + if {$useIcons} { + html {">} + } else { + html {">Full format} " | \n" + } } html {Result set} " | \n" - + if {$useIcons} { + html {">} + } else { + html {">Result set} " | \n" + } html {New query} " | \n" - + if {$useIcons} { + html {">} + } else { + html {">New query} " | \n" + } html {New target} "

\n" - - if {!$after && $no > 1} { + if {$useIcons} { + html {">} + } else { + html {">New target} + } + html "

\n" + if {!$useIcons && !$after && $no > 1} { html "

\n" html { Europagate, WWW/Z39.50 Gateway -
-Welcome to EUROPAGATE -
-Part of Europagate is a World Wide Web to Z39.50 gateway. The gateway provides search and -retrieve facilities in the databases of various libraries.

- Europagate is a -project in the -EU libraries Programme carried out by:
- University College Dublin
-Technical University & Library of Denmark
-Library Council
-Consejo Superior de Investigaciones Científicas
-


-

Choose a Z39.50 target:

+

+Welcome to EUROPAGATE + Choose a Z39.50 target:

{ foreach t [array names targets] { diff --git a/www/wcgi.c b/www/wcgi.c index be3cb96..06b8ace 100644 --- a/www/wcgi.c +++ b/www/wcgi.c @@ -41,7 +41,12 @@ * USE OR PERFORMANCE OF THIS SOFTWARE. * * $Log: wcgi.c,v $ - * Revision 1.8 1995/11/08 16:14:35 adam + * Revision 1.9 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.8 1995/11/08 16:14:35 adam * Many improvements and bug fixes. * First version that ran on dtbsun. * @@ -184,7 +189,7 @@ int main() path_info++; if (*path_info) *(path_info++) = '\0'; - if (!(gw_db = gw_db_open ("user.db", 1))) + if (!(gw_db = gw_db_open ("www.db", 1, 1))) { gw_log (GW_LOG_FATAL, prog, "gw_db_open"); exit (1); 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; diff --git a/www/z39util.tcl b/www/z39util.tcl index 216784c..fcd6bdb 100644 --- a/www/z39util.tcl +++ b/www/z39util.tcl @@ -1,5 +1,5 @@ # -# $Id: z39util.tcl,v 1.11 1995/11/14 16:01:52 adam Exp $ +# $Id: z39util.tcl,v 1.12 1995/12/20 16:31:34 adam Exp $ # proc saveState {} { uplevel #0 { @@ -118,7 +118,7 @@ proc display-raw {zset no tno} { set indicator [lindex $line 1] set fields [lindex $line 2] set l [string length $indicator] - html "$tag " + html "$tag " if {$l > 0} { for {set i 0} {$i < $l} {incr i} { if {[string index $indicator $i] == " "} { @@ -128,6 +128,7 @@ proc display-raw {zset no tno} { } } } + html "" foreach field $fields { set id [lindex $field 0] set data [lindex $field 1] @@ -155,7 +156,7 @@ proc put-marc-contents {cc} { } html $cc if {$ref != ""} { - html {">} $urltype { reference} + html {">} $cc {} } } @@ -730,3 +731,5 @@ proc displayError {msga msgb} { } html "

\n" } + +set useIcons 1 \ No newline at end of file