</head>
<body>
{
-# $Id: query.egw,v 1.7 1995/11/01 16:15:44 adam Exp $
+# $Id: query.egw,v 1.8 1995/11/02 16:35:36 adam Exp $
proc fail-response {} {
global sessionWait
set sessionWait -1
global nextSetNo
global hist
- set host $sessionParms
+ set host [lindex $sessionParms 0]
if {[info exists setNo]} {
set oldHost $hist($setNo,host)
} else {
set oldHost ""
}
- set setNo $nextSetNo
+ if {[catch {set setNo $nextSetNo}]} {
+ set nextSetNo 1
+ set setNo 1
+ }
set hist($setNo,host) $host
if {[catch {z39 failback fail-response}]} {
<input type=text name="cclentry" size=52> <br>
<hr>
<strong> Various technical parameters: </strong> <br>
-Max hits: <input type="text" name="hits" value="50" size=3>
+Max hits: <input type="text" name="hits" value="10" size=3>
Records are shown in:
<select name="format">
<option> Long format
<html>
{
-# $Id: search.egw,v 1.6 1995/11/01 16:15:45 adam Exp $
+# $Id: search.egw,v 1.7 1995/11/02 16:35:36 adam Exp $
proc search-response {sno} {
global sessionWait
set oldHost $hist($setNo,host)
if {[wform menu1] == ""} {
+ html "state 1<br>\n"
set setNo [lindex $sessionParms 0]
} else {
+ html "state 2<br>\n"
if {![info exists hist($nextSetNo,host)]} {
set hist($nextSetNo,host) $oldHost
}
set setNo $nextSetNo
+ html "using host " $hist($setNo,host) " <br\n"
incr nextSetNo
set hist($setNo,query) [build-query]
html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
html / $sessionId {/targets.egw"> New target </a>} " | \n"
html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
- html / $sessionId {/query.egw/} $host {"> New query </a>}
+ html / $sessionId {/query.egw/} $host + $setNo {"> New query </a>}
}
</body>
</html>
<html>
{
-# $Id: targets.egw,v 1.3 1995/11/01 16:15:47 adam Exp $
+# $Id: targets.egw,v 1.4 1995/11/02 16:35:36 adam Exp $
source /usr/local/etc/httpd/conf/ztargets.conf
- set nextSetNo 1
}
<head>
<title> Europagate, WWW/Z39.50 Gateway </title>
* USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $Log: wcgi.c,v $
- * Revision 1.3 1995/10/31 16:56:24 adam
+ * Revision 1.4 1995/11/02 16:35:37 adam
+ * Bug fixes and select on FIFOs in wcgi - doesn't really work!
+ *
+ * Revision 1.3 1995/10/31 16:56:24 adam
* Record presentation.
*
* Revision 1.2 1995/10/23 16:55:36 adam
}
gw_log (GW_LOG_DEBUG, prog, "Reading response.");
-#if 1
+#if 0
while ((data = read(linein, combuf, COMBUF)) > 0)
{
gw_log (GW_LOG_DEBUG, prog, "Got %d bytes", data);
}
}
#else
+# if 1
fcntl (linein, F_SETFL, O_NONBLOCK);
+# endif
while (1)
{
- fd_set s_input, s_output;
+ fd_set s_input;
+ struct timeval t;
int r;
+ t.tv_sec = 5;
+ t.tv_usec = 0;
FD_ZERO(&s_input);
- FD_ZERO(&s_output);
FD_SET(linein, &s_input);
-#if 0
+# if 0
FD_SET(1, &s_output);
-#endif
- r = select (linein + 1, &s_input, &s_output, NULL, 0);
- if (r <= 0)
+# endif
+ gw_log (GW_LOG_DEBUG, prog, "select");
+ r = select (linein + 1, &s_input, NULL, NULL, NULL);
+ if (r < 0)
{
gw_log (GW_LOG_ERRNO|GW_LOG_FATAL, prog, "select");
exit(1);
}
+ if (r == 0)
+ {
+ gw_log (GW_LOG_DEBUG, prog, "poll");
+ if ((data = read (linein, combuf, COMBUF)) > 0)
+ {
+ gw_log (GW_LOG_DEBUG, prog, "Got %d bytes", data);
+ if (write(1, combuf, data) < data)
+ {
+ gw_log (GW_LOG_FATAL|GW_LOG_ERRNO, prog, "write");
+ exit (1);
+ }
+ }
+ else if (data == -1)
+ {
+ gw_log (GW_LOG_DEBUG, prog, "No data");
+ }
+ else
+ {
+ gw_log (GW_LOG_DEBUG, prog, "No more");
+ break;
+ }
+ continue;
+ }
if (FD_ISSET (linein, &s_input))
{
- data = read(linein, combuf, COMBUF);
+ data = read (linein, combuf, COMBUF);
if (data == 0)
break;
else if (data < 0)
exit (1);
}
}
- if (FD_ISSET (1, &s_output))
+ if (FD_ISSET (1, &s_input))
{
gw_log (GW_LOG_DEBUG, prog, "stdout closed");
break;
* USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $Log: wirtcl.c,v $
- * Revision 1.6 1995/11/01 16:15:47 adam
+ * Revision 1.7 1995/11/02 16:35:37 adam
+ * Bug fixes and select on FIFOs in wcgi - doesn't really work!
+ *
+ * Revision 1.6 1995/11/01 16:15:47 adam
* Better presentation of records. Query/set number persistent.
*
* Revision 1.5 1995/10/31 16:56:24 adam
}
if (!r)
break;
+#if 1
gw_log (GW_LOG_DEBUG, mod, "fifo select %d", fifo_in);
FD_SET (fifo_in, &fdset_tcl_r);
+#endif
if ((r = select(max_fd+1, &fdset_tcl_r, &fdset_tcl_w,
- &fdset_tcl_x, 300)) < 0)
+ &fdset_tcl_x, NULL)) < 0)
{
gw_log (GW_LOG_ERRNO|GW_LOG_FATAL, mod, "select");
exit(1);
* USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $Log: wproto.c,v $
- * Revision 1.4 1995/10/31 16:56:25 adam
+ * Revision 1.5 1995/11/02 16:35:37 adam
+ * Bug fixes and select on FIFOs in wcgi - doesn't really work!
+ *
+ * Revision 1.4 1995/10/31 16:56:25 adam
* Record presentation.
*
* Revision 1.3 1995/10/27 15:12:10 adam
gw_log (GW_LOG_FATAL|GW_LOG_ERRNO, mod, "write response");
return -1;
}
+ gw_log (GW_LOG_DEBUG, mod, "wrote %d bytes", wrote);
if (wc->cache_fd >= 0)
if (write(wc->cache_fd, wc->outbuffer + wc->outbuffer_offset,
towrite) < 0)
gw_log (GW_LOG_STAT, mod,
"wproto_process returning 0 after %d second timeout.",
timeout);
+ unlink (wc->wf_serverp);
return 0;
}
/* determine handle (fifo or user) */
wo_finish(wc);
}
else
+ {
+ unlink (wc->wf_serverp);
return 1;
+ }
}
}