From ab79448b67b5b423fe2d5c68124e94ad27fc8ecd Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 2 Feb 2004 15:11:40 +0000 Subject: [PATCH] Set referenceId for response PDU to avoid unknown IDs for Voyager target --- include/yaz++/proxy.h | 3 ++- src/yaz-proxy.cpp | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/include/yaz++/proxy.h b/include/yaz++/proxy.h index 3868730..0cbe124 100644 --- a/include/yaz++/proxy.h +++ b/include/yaz++/proxy.h @@ -2,7 +2,7 @@ * Copyright (c) 1998-2004, Index Data. * See the file LICENSE for details. * - * $Id: proxy.h,v 1.37 2004-01-30 11:45:25 adam Exp $ + * $Id: proxy.h,v 1.38 2004-02-02 15:11:40 adam Exp $ */ #include @@ -281,6 +281,7 @@ class YAZ_EXPORT Yaz_Proxy : public Yaz_Z_Assoc { struct timeval m_time_tv; void logtime(); Z_ElementSetNames *mk_esn_from_schema(ODR o, const char *schema); + Z_ReferenceId **m_referenceId; public: Yaz_Proxy(IYaz_PDU_Observable *the_PDU_Observable, Yaz_Proxy *parent = 0); diff --git a/src/yaz-proxy.cpp b/src/yaz-proxy.cpp index 4aff767..0e423d9 100644 --- a/src/yaz-proxy.cpp +++ b/src/yaz-proxy.cpp @@ -2,7 +2,7 @@ * Copyright (c) 1998-2004, Index Data. * See the file LICENSE for details. * - * $Id: yaz-proxy.cpp,v 1.96 2004-02-02 11:17:45 adam Exp $ + * $Id: yaz-proxy.cpp,v 1.97 2004-02-02 15:11:41 adam Exp $ */ #include @@ -100,6 +100,7 @@ Yaz_Proxy::Yaz_Proxy(IYaz_PDU_Observable *the_PDU_Observable, m_config_fname = 0; m_request_no = 0; m_invalid_session = 0; + m_referenceId = 0; m_config = 0; m_marcxml_flag = 0; m_stylesheet_xsp = 0; @@ -978,6 +979,11 @@ int Yaz_Proxy::send_PDU_convert(Z_APDU *apdu) int Yaz_Proxy::send_to_client(Z_APDU *apdu) { int kill_session = 0; + Z_ReferenceId **new_id = get_referenceIdP(apdu); + + if (new_id && m_referenceId) + *new_id = *m_referenceId; + if (apdu->which == Z_APDU_searchResponse) { Z_SearchResponse *sr = apdu->u.searchResponse; @@ -1917,6 +1923,8 @@ void Yaz_Proxy::handle_incoming_Z_PDU(Z_APDU *apdu) m_mem_invalid_session = odr_extract_mem(odr_decode()); apdu = m_initRequest_apdu; } + + m_referenceId = get_referenceIdP(apdu); // Determine our client. Z_OtherInformation **oi; -- 1.7.10.4