X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=www%2Fquery.egw;h=b4217107d87d923984950c562e1fa46e06d58ca7;hb=644da8e5a840d868f7b31cf94fea111d0fa43a4a;hp=9a72fe31b94ddc7d8a232239a5fdf4ac18c1e9ba;hpb=94e0e8ff10cdb5142f983cd76156310461f9eb89;p=egate.git
diff --git a/www/query.egw b/www/query.egw
index 9a72fe3..b421710 100644
--- a/www/query.egw
+++ b/www/query.egw
@@ -1,13 +1,13 @@
-
- WWW/Z39.50 Gateway Query Form
-
-
{
-# $Id: query.egw,v 1.9 1995/11/06 17:44:20 adam Exp $
+# $Id: query.egw,v 1.40 1996/05/24 11:16:01 adam Exp $
if {[info commands saveState] == ""} {
source z39util.tcl
+ if {![info exists debug]} {
+ session-lost
+ egw_abort
+ }
}
proc fail-response {} {
@@ -24,59 +24,102 @@ proc ok-response {} {
global nextSetNo
global hist
- set host [lindex $sessionParms 0]
+ html { WWW/Z39.50 Gateway Query Form}
+
+ set initSet [lindex $sessionParms 0]
+ set host [lindex $sessionParms 1]
+ set scanLine [lindex $sessionParms 2]
+ set scanTerm [lrange $sessionParms 3 end]
- if {[info exists setNo]} {
- set oldHost $hist($setNo,host)
- } else {
- set oldHost ""
- }
if {[catch {set setNo $nextSetNo}]} {
set nextSetNo 1
set setNo 1
}
- set hist($setNo,host) $host
-
- if {[catch {z39 failback fail-response}]} {
- ir z39
+ if {[catch {set oldHost [z390 connect]}]} {
+ set oldHost ""
}
- z39 callback ok-response
- z39 failback fail-response
- if {$host != $oldHost} {
- catch {z39 disconnect}
- html "Connecting to target " $host "
\n"
+ set hist($setNo,0,host) $host
+ set hist($setNo,0,idAuthentication) [lindex $targets($host) 3]
+
+ mkAssoc z390 $host
+
+ z390 callback ok-response
+ z390 failback fail-response
+ set thisHost [splitHostSpec $host]
+ if {[string compare $thisHost $oldHost]} {
+ catch {z390 disconnect}
+
set sessionWait 0
- if {[catch {z39 connect $host}]} {
- html "Cannot connect to target ${host}
\n"
+ if {[catch {z390 connect $thisHost}]} {
+ displayError "Cannot connect to target ${thisHost}" {}
html "\n"
- wabort
+ z390 disconnect
+ egw_abort
} elseif {$sessionWait == 0} {
- zwait sessionWait
+ if {[catch {egw_wait sessionWait 35}]} {
+ displayError "Cannot connect to target ${thisHost}" {}
+ html "