X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;ds=sidebyside;f=src%2Fyaz-proxy.cpp;h=656af5b306f9bd95f07c01f1c478fac89314a1f1;hb=008ab62580aa7f271e95871b9d2df2ac9e7a7a28;hp=872cee6d4b39b5299f950a1e7748d4a9e72ac91e;hpb=ab004a9c8d93f4f906ce643e306efe9dece8a2ce;p=yazpp-moved-to-github.git diff --git a/src/yaz-proxy.cpp b/src/yaz-proxy.cpp index 872cee6..656af5b 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.98 2004-02-10 15:02:19 adam Exp $ + * $Id: yaz-proxy.cpp,v 1.101 2004-02-15 16:41:14 adam Exp $ */ #include @@ -638,7 +638,7 @@ void Yaz_Proxy::convert_xsl_delay() xsltFreeStylesheet(m_stylesheet_xsp); m_stylesheet_xsp = 0; timeout(m_client_idletime); - int r = send_PDU_convert(m_stylesheet_apdu); + send_PDU_convert(m_stylesheet_apdu); } else timeout(0); @@ -896,6 +896,7 @@ int Yaz_Proxy::send_srw_explain_response(Z_SRW_diagnostic *diagnostics, er->record.recordData_buf = b; er->record.recordData_len = len; er->record.recordPacking = m_s2z_packing; + er->record.recordSchema = "http://explain.z3950.org/dtd/2.0/"; er->diagnostics = diagnostics; er->num_diagnostics = num_diagnostics; @@ -1997,19 +1998,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; }