From: Adam Dickmeiss Date: Fri, 27 Feb 1998 14:26:07 +0000 (+0000) Subject: Changed client so that it still works if target sets numberOfRecords X-Git-Tag: IRTCL.1.4~58 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=47a7d820033bfdf3334f209cb4b4c17aca8bdd92;p=ir-tcl-moved-to-github.git Changed client so that it still works if target sets numberOfRecords in response to an illegal value. --- diff --git a/CHANGELOG b/CHANGELOG index 2cda361..4df676a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,4 @@ -$Id: CHANGELOG,v 1.35 1997-11-19 11:20:56 adam Exp $ +$Id: CHANGELOG,v 1.36 1998-02-27 14:26:07 adam Exp $ 06/19/95 Release of ir-tcl-1.0b ------------------------------------------------------ @@ -101,8 +101,6 @@ $Id: CHANGELOG,v 1.35 1997-11-19 11:20:56 adam Exp $ 08/09/96 Updated IrTcl to work with tcl7.5/tk4.1 patch level 1. The asynchronous I/O works much better on Windows now. -08/09/96 Borland C 5 makefile supplied with IrTcl. - 08/21/96 New method, saveFile, that saves DB of records to a file. 08/21/96 loadFile method changed to use load records previously saved diff --git a/ir-tcl.c b/ir-tcl.c index 1048cf0..d24437f 100644 --- a/ir-tcl.c +++ b/ir-tcl.c @@ -1,11 +1,15 @@ /* * IR toolkit for tcl/tk - * (c) Index Data 1995-1997 + * (c) Index Data 1995-1998 * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: ir-tcl.c,v $ - * Revision 1.103 1997-11-19 11:22:10 adam + * Revision 1.104 1998-02-27 14:26:07 adam + * Changed client so that it still works if target sets numberOfRecords + * in response to an illegal value. + * + * Revision 1.103 1997/11/19 11:22:10 adam * Object identifiers can be accessed in GRS-1 records. * * Revision 1.102 1997/09/17 12:22:40 adam @@ -2609,7 +2613,7 @@ static int do_getExplain (void *o, Tcl_Interp *interp, int argc, char **argv) return TCL_OK; assert (rl->u.dbrec.buf); odr_setbuf (p->odr_in, rl->u.dbrec.buf, rl->u.dbrec.size, 0); - if (!(*etype->fun)(p->odr_in, &rr, 0)) + if (!(*etype->fun)(p->odr_in, (char **) &rr, 0)) return TCL_OK; if (etype->what != Z_External_explainRecord) @@ -3589,7 +3593,7 @@ static void ir_handleDBRecord (IrTcl_Obj *p, IrTcl_RecordList *rl, odr_setbuf (p->odr_in, (char*) oe->u.octet_aligned->buf, oe->u.octet_aligned->len, 0); - if (!(*etype->fun)(p->odr_in, &rr, 0)) + if (!(*etype->fun)(p->odr_in, (char **) &rr, 0)) return; switch (etype->what) { @@ -3661,11 +3665,15 @@ static void ir_handleZRecords (void *o, Z_Records *zrs, IrTcl_SetObj *setobj, &setobj->nonSurrogateDiagnosticNum); if (zrs->which == Z_Records_DBOSD) { - int num_rec = setobj->numberOfRecordsReturned; + int num_rec = zrs->u.databaseOrSurDiagnostics->num_records; + + if (num_rec != setobj->numberOfRecordsReturned) + { + logf (LOG_WARN, "numberOfRecordsReturned=%d but num records=%d", + setobj->numberOfRecordsReturned, num_rec); + setobj->numberOfRecordsReturned = num_rec; + } - if (num_rec > zrs->u.databaseOrSurDiagnostics->num_records) - num_rec = zrs->u.databaseOrSurDiagnostics->num_records; - logf (LOG_DEBUG, "Got %d records", num_rec); for (offset = 0; offset < num_rec; offset++) { Z_NamePlusRecord *znpr = zrs->u.databaseOrSurDiagnostics-> diff --git a/irtdb.tcl b/irtdb.tcl index 2dc5b03..dc72345 100644 --- a/irtdb.tcl +++ b/irtdb.tcl @@ -94,7 +94,7 @@ set profile(DanBib,maximumRecordSize) 50000 set profile(DanBib,mediumSetPresentNumber) 0 set profile(DanBib,multipleDatabases) 0 set profile(DanBib,namedResultSets) 1 -set profile(DanBib,port) 2100 +set profile(DanBib,port) 210 set profile(DanBib,preferredMessageSize) 30000 set profile(DanBib,presentChunk) 4 set profile(DanBib,protocol) Z39 @@ -105,7 +105,7 @@ set profile(DanBib,smallSetUpperBound) 0 set profile(DanBib,targetInfoName) {} set profile(DanBib,timeDefine) 878567355 set profile(DanBib,timeLastExplain) {} -set profile(DanBib,timeLastInit) 887289885 +set profile(DanBib,timeLastInit) 888495120 set profile(DanBib,welcomeMessage) {} set profile(DanBib,windowNumber) 2 set profile(Default,authentication) {}