From 3cbb17ba89f52d01d20df67073fdbc8bbda4ae0d Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 12 Feb 2004 20:40:22 +0000 Subject: [PATCH] Fixed SEGV bug that occured when duplicate init requests was received and no cached init response was available. --- ChangeLog | 4 +++- src/yaz-proxy.cpp | 31 +++++++++++++++++-------------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3889490..f1e1190 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ +Fixed SEGV bug that occured when duplicate init requests was received and +no cached init response was available. Add MODS version 3 conversion, MARC21slim2MODS3.xsl. Update voyager.xml, -config.xml to use it. +config.xml to use it. Default "mods" is still MODS v2. --- 0.7.7 2004/02/10 Internal release. diff --git a/src/yaz-proxy.cpp b/src/yaz-proxy.cpp index 23538ad..83fae8a 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.99 2004-02-11 10:01:54 adam Exp $ + * $Id: yaz-proxy.cpp,v 1.100 2004-02-12 20:40:22 adam Exp $ */ #include @@ -1997,19 +1997,22 @@ void Yaz_Proxy::handle_incoming_Z_PDU(Z_APDU *apdu) { if (handle_init_response_for_invalid_session(apdu)) return; - Z_APDU *apdu2 = m_client->m_initResponse; - apdu2->u.initResponse->otherInfo = 0; - if (m_client->m_cookie && *m_client->m_cookie) - set_otherInformationString(apdu2, VAL_COOKIE, 1, - m_client->m_cookie); - apdu2->u.initResponse->referenceId = - apdu->u.initRequest->referenceId; - apdu2->u.initResponse->options = m_client->m_initResponse_options; - apdu2->u.initResponse->protocolVersion = - m_client->m_initResponse_version; - - send_to_client(apdu2); - return; + if (m_client->m_initResponse) + { + Z_APDU *apdu2 = m_client->m_initResponse; + apdu2->u.initResponse->otherInfo = 0; + if (m_client->m_cookie && *m_client->m_cookie) + set_otherInformationString(apdu2, VAL_COOKIE, 1, + m_client->m_cookie); + apdu2->u.initResponse->referenceId = + apdu->u.initRequest->referenceId; + apdu2->u.initResponse->options = m_client->m_initResponse_options; + apdu2->u.initResponse->protocolVersion = + m_client->m_initResponse_version; + + send_to_client(apdu2); + return; + } } m_client->m_init_flag = 1; } -- 1.7.10.4