X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=src%2Fyaz-proxy.cpp;h=83fae8ac89616d5a12d67bcd746b657d06845cfd;hb=3cbb17ba89f52d01d20df67073fdbc8bbda4ae0d;hp=23538addd29b1308303bcbc4efa52732e9af35b4;hpb=c7bf3da80883df6206451d763edfdf41f6f82f61;p=yazpp-moved-to-github.git 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; }