From 5e8a1c1d1f14d915a82d9b8df5b09ba75bb201ec Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 21 Feb 1996 14:58:35 +0000 Subject: [PATCH] Bug fix: didn't cache properly when using multiple targets. --- www/z39util.tcl | 26 +++++++++++++++++--------- www/ztargets.conf | 26 ++++++++++++-------------- 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/www/z39util.tcl b/www/z39util.tcl index cafca96..ffdb837 100644 --- a/www/z39util.tcl +++ b/www/z39util.tcl @@ -1,5 +1,5 @@ # -# $Id: z39util.tcl,v 1.31 1996/02/20 16:07:39 adam Exp $ +# $Id: z39util.tcl,v 1.32 1996/02/21 14:58:35 adam Exp $ # proc saveState {} { uplevel #0 { @@ -706,15 +706,19 @@ proc z39search {setNo piggy tno elements} { displayError "Cannot initialize target $thisHost" $u return 0 } - } else { - if {[info exists hist($setNo,hits)] && \ - ![catch [list $zz.$setNo smallSetUpperBound 0]]} { - return 1 + } elseif {![catch [list $zz.$setNo smallSetUpperBound 0]]} { + if {$tno > 0} { + if {[info exists hist($setNo,$tno,hits)]} { + return 1 + } + } else { + if {[info exists hist($setNo,hits)]} { + return 1 + } } - } ir-set $zz.$setNo $zz - + if {![lindex $targets($host) 5]} { set elements {} } @@ -805,13 +809,17 @@ proc search-m-response {setNo i start number} { egw_log debug "search-m-response" set status [z39$i.$setNo responseStatus] egw_log debug "search-m-response1" - if {[lindex $status 0] != "DBOSD"} { + if {[lindex $status 0] == "OK"} { + set nor 0 + } elseif {[lindex $status 0] == "DBOSD"} { + set nor [z39$i.$setNo numberOfRecordsReturned] + } else { egw_log debug "search-m-response2" incr zleft -1 set zstatus($i) 2 return } - set nor [z39$i.$setNo numberOfRecordsReturned] + set hist($setNo,$i,hits) [z39$i.$setNo resultCount] egw_log debug "search-m-response3" set hist($setNo,$i,offset) [expr $start + $nor -1] if {[expr $nor + $start] > [z39$i.$setNo resultCount]} { diff --git a/www/ztargets.conf b/www/ztargets.conf index 6d8c2e1..c1c1d67 100644 --- a/www/ztargets.conf +++ b/www/ztargets.conf @@ -1,4 +1,4 @@ -# $Id: ztargets.conf,v 1.23 1996/02/19 15:45:00 adam Exp $ +# $Id: ztargets.conf,v 1.24 1996/02/21 14:58:36 adam Exp $ # # This file contains the predefined targets in the WWW-Z59.50 gateway # Each target is an entry in associative array "targets". The @@ -69,16 +69,16 @@ set targets(z3950.bibsys.no:2100.BIBSYS) [list \ 0 \ ] -set targets(dtbsun.dtv.dk:4501.DEM) [list \ - Aleph \ - DEM \ - $commonFields \ - {} \ - {Aleph Test server at DTV} \ - 0 \ -] +#set targets(dtbsun.dtv.dk:4501.DEM) [list \ +# Aleph \ +# DEM \ +# $commonFields \ +# {} \ +# {Aleph Test server at DTV} \ +# 0 \ +#] -set targets(dallas.ucd.ie:7777.danbib) { +set targets(ir.dbc.bib.dk:2008.danbib) { DanBib danbib { @@ -86,12 +86,10 @@ set targets(dallas.ucd.ie:7777.danbib) { { Author {@attr 1=1003} } { Abstract {@attr 1=62} } { Date {@attr 1=30} } - { {Doc ID} {@attr 1=1032} } { All {@attr 1=1016} } - { Ranked {@attr 1=1016 @attr 4=105} } } - {<>} - {Z39.50->SR gateway to SR target DanBib} + {} + {Danish Union Catalogue} 0 } -- 1.7.10.4