Fixed NULL ptr refernece that could occur if a client sets negotiation
authorAdam Dickmeiss <adam@indexdata.dk>
Fri, 10 Jun 2005 17:54:10 +0000 (17:54 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Fri, 10 Jun 2005 17:54:10 +0000 (17:54 +0000)
option but do not include character set negotiation record.

etc/voyager.xml
src/yaz-proxy.cpp

index aee91a6..c28da9e 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<!-- $Id: voyager.xml,v 1.5 2005-02-22 10:08:19 adam Exp $ -->
+<!-- $Id: voyager.xml,v 1.6 2005-06-10 17:54:10 adam Exp $ -->
 <proxy xmlns="http://indexdata.dk/yazproxy/schema/0.9/"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://indexdata.dk/yazproxy/schema/0.9/ yazproxy.xsd"
@@ -99,7 +99,7 @@
     <syntax type="*" error="238"/>
 
     <!-- keep this number of spare sessions for future sessions -->
-    <preinit>2</preinit>
+    <preinit>0</preinit>
 
     <explain xmlns="http://explain.z3950.org/dtd/2.0/">
       <serverInfo>
   <!-- what we log. Allowed tokens: client-apdu, server-apdu,
   client-requests, server-requests -->
   <log>client-requests server-requests</log>
+  <xlog></xlog>
 </proxy>
index 9280b83..45fe382 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: yaz-proxy.cpp,v 1.30 2005-06-08 13:29:03 adam Exp $
+/* $Id: yaz-proxy.cpp,v 1.31 2005-06-10 17:54:11 adam Exp $
    Copyright (c) 1998-2005, Index Data.
 
 This file is part of the yaz-proxy.
@@ -2682,13 +2682,15 @@ void Yaz_Proxy::handle_init(Z_APDU *apdu)
        m_initRequest_maximumRecordSize = *apdu->u.initRequest->
            maximumRecordSize;
        *apdu->u.initRequest->maximumRecordSize = 1024*1024;
+
+       Z_CharSetandLanguageNegotiation *charSetandLangRecord =
+           yaz_get_charneg_record(*oi);
        
        // Save proposal charsets and langs.
        if (ODR_MASK_GET(apdu->u.initRequest->options,
-                        Z_Options_negotiationModel))
+                        Z_Options_negotiationModel) 
+           && charSetandLangRecord)
        {
-           Z_CharSetandLanguageNegotiation *charSetandLangRecord =
-               yaz_get_charneg_record(*oi);
            
            yaz_get_proposal_charneg(m_referenceId_mem,
                                     charSetandLangRecord,