From 5ed675e0effebe4b7816e1db060356a85d7757ba Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 10 Sep 2002 13:00:58 +0000 Subject: [PATCH] Use ResultSetId for lookup in result set cache --- include/yaz++/yaz-proxy.h | 3 ++- src/yaz-proxy.cpp | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/yaz++/yaz-proxy.h b/include/yaz++/yaz-proxy.h index 4ef900c..0595e51 100644 --- a/include/yaz++/yaz-proxy.h +++ b/include/yaz++/yaz-proxy.h @@ -2,7 +2,7 @@ * Copyright (c) 1998-2000, Index Data. * See the file LICENSE for details. * - * $Id: yaz-proxy.h,v 1.6 2002-09-10 11:58:13 adam Exp $ + * $Id: yaz-proxy.h,v 1.7 2002-09-10 13:01:14 adam Exp $ */ #include @@ -30,6 +30,7 @@ class YAZ_EXPORT Yaz_ProxyClient : public Yaz_Z_Assoc { int m_init_flag; Yaz_Z_Query *m_last_query; Yaz_Z_Databases m_last_databases; + char *m_last_resultSetId; int m_last_ok; int m_last_resultCount; int m_sr_transform; diff --git a/src/yaz-proxy.cpp b/src/yaz-proxy.cpp index 6705d92..217b660 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.34 2002-09-10 11:58:13 adam Exp $ + * $Id: yaz-proxy.cpp,v 1.35 2002-09-10 13:00:58 adam Exp $ */ #include @@ -277,6 +277,7 @@ Z_APDU *Yaz_Proxy::result_set_optimize(Z_APDU *apdu) if (m_client->m_last_ok && m_client->m_last_query && m_client->m_last_query->match(this_query) && + !strcmp(m_client->m_last_resultSetId, sr->resultSetName) && m_client->m_last_databases.match(this_databases)) { delete this_query; @@ -341,6 +342,10 @@ Z_APDU *Yaz_Proxy::result_set_optimize(Z_APDU *apdu) delete m_client->m_last_query; m_client->m_last_query = this_query; m_client->m_last_ok = 0; + + xfree (m_client->m_last_resultSetId); + m_client->m_last_resultSetId = xstrdup (sr->resultSetName); + m_client->m_last_databases.set(sr->num_databaseNames, (const char **) sr->databaseNames); } @@ -490,6 +495,7 @@ Yaz_ProxyClient::~Yaz_ProxyClient() m_waiting = 2; // for debugging purposes only. odr_destroy(m_init_odr); delete m_last_query; + xfree (m_last_resultSetId); } void Yaz_Proxy::timeoutNotify() @@ -512,6 +518,7 @@ Yaz_ProxyClient::Yaz_ProxyClient(IYaz_PDU_Observable *the_PDU_Observable) : m_prev = 0; m_init_flag = 0; m_last_query = 0; + m_last_resultSetId = 0; m_last_resultCount = 0; m_last_ok = 0; m_sr_transform = 0; -- 1.7.10.4