Makefile enhanced.
[egate.git] / www / z39util.tcl
index ba0b55e..e893729 100644 (file)
@@ -1,5 +1,5 @@
 #
-# $Id: z39util.tcl,v 1.40 1996/03/13 14:07:32 adam Exp $
+# $Id: z39util.tcl,v 1.43 1996/03/26 16:27:03 adam Exp $
 #
 proc saveState {} {
     uplevel #0 {
@@ -162,7 +162,7 @@ proc display-medium {zset no setNo targetNo} {
             html "No Title"
         }
         html {</a> }
-        if {[scan $score %d nscore]} {
+        if {[scan $score %d nscore] == 1} {
             html "; Score " $nscore
         }
     } else {
@@ -1134,7 +1134,20 @@ proc z39msearch {setNo elements start number cache} {
     }
     while {$zleft > 0} {
         egw_log debug "Waiting for init response"
-        if {[catch {egw_wait zleft 20}]} {
+        if {[catch {egw_wait zleft 20} reason]} {
+            if {![string compare $reason cancel]} {
+                for {set i 1} {$i <= $not} {incr i} {
+                    set zstatus($i) -1
+                    catch {z39$i disconnect}
+                }
+                return
+            } else {
+                for {set i 1} {$i <= $not} {incr i} {
+                    if {$zstatus($i) == -1} {
+                        catch {z39$i disconnect}
+                    }
+                }
+            }
             break
         }
     }
@@ -1241,9 +1254,24 @@ proc z39msearch {setNo elements start number cache} {
             }
         }
     }
+
+
     while {$zleft > 0} {
         egw_log debug "Waiting for search/present response"
-        if {[catch {egw_wait zleft 60}]} {
+        if {[catch {egw_wait zleft 60} reason]} {
+            if {![string compare $reason cancel]} {
+                for {set i 1} {$i <= $not} {incr i} {
+                    catch {z39$i disconnect}
+                    set zstatus($i) -1
+                }
+                return
+            } else {
+                for {set i 1} {$i <= $not} {incr i} {
+                    if {$zstatus($i) != 2} {
+                        catch {z39$i disconnect}
+                    }
+                }
+            }
             break
         }
     }
@@ -1784,9 +1812,7 @@ proc button-scan-window {setNo} {
 proc maintenance {} {
     html {<hr>This page is maintained by }
     html {<a href="mailto:pwh@dtv.dk"> Peter Wad Hansen </a>.}
-    html {Last modified 29. january 1996. <br>}
-    html {<em> This and the following pages are under construction and }
-    html {will continue to be so until the end of January 1996.</em>}
+    html {Last modified March 15, 1996. <br>}
 }
 
 proc splitHostSpec {host} {
@@ -1872,6 +1898,22 @@ proc serverList {headlineProc targetProc} {
     rename targetsCmp {}
 }
 
+proc session-lost {} {
+    global useIcons
+
+    html {<head><title>WWW/Z39.50 Gateway: Session Expired</title></head>}
+    html \n {<body>}
+    set useIcons 1
+    button-main
+    html {<h1>Session Expired</h1>}
+    html {Your session has expired. Please reload the gateways' }
+    html {front page.<br><br>} \n
+    set useIcons 0
+    button-main
+    html {</body></html>}
+}
+
 if {[info exists utilExtension]} {
     source $utilExtension
-}
\ No newline at end of file
+}
+