From 929ee1e0accc079beb8b2db96a104620daf3f718 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 24 Jan 2003 20:10:57 +0000 Subject: [PATCH] Fix Present request out of range for proxy --- ChangeLog | 3 +++ src/yaz-proxy.cpp | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index ce23ba4..e0de222 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +Bug fix: in some cases the Proxy could issue a Present Request +which was out of range (code 13). + New autoconf m4 macro in yazpp.m4. Fix creation of src/yaz++-config so that it works if srcdir != objdir. diff --git a/src/yaz-proxy.cpp b/src/yaz-proxy.cpp index f61547a..5f364f2 100644 --- a/src/yaz-proxy.cpp +++ b/src/yaz-proxy.cpp @@ -2,7 +2,7 @@ * Copyright (c) 1998-2001, Index Data. * See the file LICENSE for details. * - * $Id: yaz-proxy.cpp,v 1.37 2002-10-23 10:15:18 adam Exp $ + * $Id: yaz-proxy.cpp,v 1.38 2003-01-24 20:10:57 adam Exp $ */ #include @@ -265,8 +265,8 @@ Z_APDU *Yaz_Proxy::result_set_optimize(Z_APDU *apdu) { if (apdu->which != Z_APDU_searchRequest) return apdu; - if (*m_parent->m_optimize != '1') - return apdu; + if (*m_parent->m_optimize == '0') + return apdu; // don't optimize result sets.. Z_SearchRequest *sr = apdu->u.searchRequest; Yaz_Z_Query *this_query = new Yaz_Z_Query; Yaz_Z_Databases this_databases; @@ -293,7 +293,10 @@ Z_APDU *Yaz_Proxy::result_set_optimize(Z_APDU *apdu) pr->referenceId = sr->referenceId; pr->resultSetId = sr->resultSetName; pr->preferredRecordSyntax = sr->preferredRecordSyntax; - *pr->numberOfRecordsRequested = *sr->mediumSetPresentNumber; + if (*sr->mediumSetPresentNumber < m_client->m_last_resultCount) + *pr->numberOfRecordsRequested = *sr->mediumSetPresentNumber; + else + *pr->numberOfRecordsRequested = m_client->m_last_resultCount; if (sr->mediumSetElementSetNames) { pr->recordComposition = (Z_RecordComposition *) -- 1.7.10.4