Omit check for piggyback
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 23 Oct 2003 08:46:55 +0000 (08:46 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 23 Oct 2003 08:46:55 +0000 (08:46 +0000)
src/config.xml
src/yaz-pdu-assoc.cpp
src/yaz-proxy.cpp

index b07af96..4eeb81b 100644 (file)
@@ -1,48 +1,52 @@
 <?xml version="1.0"?>
-<!-- $Id: config.xml,v 1.13 2003-10-20 18:31:43 adam Exp $ -->
+<!-- $Id: config.xml,v 1.14 2003-10-23 08:46:55 adam Exp $ -->
 <proxy>
   <target default="1" name="voyager">
     <!-- default target -->
-    <url>z3950.loc.gov:7090</url>
-    <url>z3950.loc.gov:7094</url>
+    <url>bagel.indexdata.dk</url>
+    <target-timeout>240</target-timeout>
+    <client-timeout>180</client-timeout>
     <keepalive>
-      <bandwidth>500000</bandwidth>
-      <pdu>500</pdu>
+      <bandwidth>1000000</bandwidth>
+      <pdu>1000</pdu>
     </keepalive>
-    <limit><!-- limits .. -->
-      <bandwidth>200000</bandwidth>
-      <pdu>31</pdu>
-      <retrieve>20</retrieve>
+    <limit><!-- per minute limits .. -->
+      <bandwidth>2000000</bandwidth>
+      <pdu>50</pdu>
+      <retrieve>100</retrieve>
     </limit>
     <attribute type="1" value="1-11,13-1010"/>
     <attribute type="1" value="*" error="114"/>
-    <target-timeout>240</target-timeout>
-    <client-timeout>180</client-timeout>
+    <syntax type="opac"/>
     <syntax type="usmarc"/>
+    <syntax type="none"/>
     <syntax type="xml" marcxml="1"/>
     <syntax type="*" error="238"/>
-    <preinit>2</preinit>
+    <preinit>0</preinit>
   </target>
   <target name="localhost">
     <url>localhost:9999</url>
+    <url>localhost:9998</url>
+    <target-timeout>300</target-timeout>
+    <client-timeout>180</client-timeout>
     <keepalive/> <!-- keepalive enabled -->
     <limit><!-- limits .. -->
       <bandwidth>50000</bandwidth>
       <pdu>60</pdu>
       <retrieve>10</retrieve>
     </limit>
-    <target-timeout>300</target-timeout>
-    <client-timeout>180</client-timeout>
-    <attribute type="1" value="10,1023-9000" error="114"/>
+    <attribute type="1" value="1-1023">
+    <attribute type="1" value="*" error="114"/>
     <syntax type="usmarc"/>
     <syntax type="grs1"/>
     <syntax type="xml" marcxml="1"/>
+    <syntax type="none"/>
     <syntax type="*" error="238"/>
-    <preinit>0</preinit>
+    <preinit>2</preinit>
   </target>
   <target name="*">
     <!-- everything else -->
   </target>
-  <max-clients>500</max-clients>
-  <xlog>client-apdu server-apdu</xlog>
+  <max-clients>50</max-clients>
+  <log>client-apdu server-apdu</log>
 </proxy>
index aa149d6..6ee18f6 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (c) 1998-2003, Index Data.
  * See the file LICENSE for details.
  * 
- * $Id: yaz-pdu-assoc.cpp,v 1.35 2003-10-20 18:31:44 adam Exp $
+ * $Id: yaz-pdu-assoc.cpp,v 1.36 2003-10-23 08:46:55 adam Exp $
  */
 
 #include <assert.h>
@@ -20,6 +20,7 @@ void Yaz_PDU_Assoc::init(IYazSocketObservable *socketObservable)
     m_socketObservable = socketObservable;
     m_PDU_Observer = 0;
     m_queue_out = 0;
+    m_queue_in = 0;
     m_input_buf = 0;
     m_input_len = 0;
     m_children = 0;
@@ -208,8 +209,15 @@ void Yaz_PDU_Assoc::socketNotify(int event)
 
                if (!m_PDU_Observer)
                    return;
-
+#if 0
+               PDU_Queue **pq = &m_queue_in;
+               while (*pq)
+                   pq = &(*pq)->m_next;
+               
+               *pq = new PDU_Queue(m_input_buf, res);
+#else
                m_PDU_Observer->recv_PDU(m_input_buf, res);
+#endif
                if (destroyed)   // it really was destroyed, return now.
                    return;
                 m_destroyed = 0;
index 996f258..7c80f99 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (c) 1998-2003, Index Data.
  * See the file LICENSE for details.
  * 
- * $Id: yaz-proxy.cpp,v 1.63 2003-10-20 18:31:44 adam Exp $
+ * $Id: yaz-proxy.cpp,v 1.64 2003-10-23 08:46:55 adam Exp $
  */
 
 #include <assert.h>
@@ -355,9 +355,8 @@ Yaz_ProxyClient *Yaz_Proxy::get_client(Z_APDU *apdu)
                !strcmp(m_proxyTarget, c->get_hostname()))
            {
                // found it in cache
-               yaz_log (LOG_LOG, "%sREUSE %d %d %s",
-                        m_session_str,
-                        c->m_seqno, parent->m_seqno, c->get_hostname());
+               yaz_log (LOG_LOG, "%sREUSE %s",
+                        m_session_str, c->get_hostname());
                
                c->m_seqno = parent->m_seqno;
                assert(c->m_server == 0);
@@ -665,7 +664,6 @@ Z_APDU *Yaz_Proxy::result_set_optimize(Z_APDU *apdu)
     if (apdu->which == Z_APDU_presentRequest)
     {
        Z_PresentRequest *pr = apdu->u.presentRequest;
-       Z_NamePlusRecordList *npr;
        int toget = *pr->numberOfRecordsRequested;
        int start = *pr->resultSetStartPoint;
 
@@ -684,6 +682,7 @@ Z_APDU *Yaz_Proxy::result_set_optimize(Z_APDU *apdu)
            send_to_client(new_apdu);
            return 0;
        }
+#if 0
        if (!strcmp(m_client->m_last_resultSetId, pr->resultSetId))
        {
            if (start+toget-1 > m_client->m_last_resultCount)
@@ -717,6 +716,7 @@ Z_APDU *Yaz_Proxy::result_set_optimize(Z_APDU *apdu)
                return 0;
            }
        }
+#endif
     }
 
     if (apdu->which != Z_APDU_searchRequest)
@@ -1010,37 +1010,34 @@ Z_APDU *Yaz_Proxy::handle_syntax_validation(Z_APDU *apdu)
     if (apdu->which == Z_APDU_searchRequest)
     {
        Z_SearchRequest *sr = apdu->u.searchRequest;
-       if (*sr->smallSetUpperBound > 0 || *sr->mediumSetPresentNumber > 0)
+       int err = 0;
+       char *addinfo = 0;
+       Yaz_ProxyConfig *cfg = check_reconfigure();
+       
+       if (cfg)
+           err = cfg->check_syntax(odr_encode(),
+                                   m_default_target,
+                                   sr->preferredRecordSyntax,
+                                   &addinfo);
+       if (err == -1)
        {
-           int err = 0;
-           char *addinfo = 0;
-           Yaz_ProxyConfig *cfg = check_reconfigure();
-
-           if (cfg)
-               err = cfg->check_syntax(odr_encode(),
-                                       m_default_target,
-                                       sr->preferredRecordSyntax,
-                                       &addinfo);
-           if (err == -1)
-           {
-               sr->preferredRecordSyntax =
-                   yaz_oidval_to_z3950oid(odr_decode(), CLASS_RECSYN,
-                                          VAL_USMARC);
-               m_marcxml_flag = 1;
-           }
-           else if (err)
-           {
-               Z_APDU *new_apdu = create_Z_PDU(Z_APDU_searchResponse);
-               
-               new_apdu->u.searchResponse->referenceId = sr->referenceId;
-               new_apdu->u.searchResponse->records =
-                   create_nonSurrogateDiagnostics(odr_encode(), err, addinfo);
-               *new_apdu->u.searchResponse->searchStatus = 0;
-               
-               send_to_client(new_apdu);
-               
-               return 0;
-           }
+           sr->preferredRecordSyntax =
+               yaz_oidval_to_z3950oid(odr_decode(), CLASS_RECSYN,
+                                      VAL_USMARC);
+           m_marcxml_flag = 1;
+       }
+       else if (err)
+       {
+           Z_APDU *new_apdu = create_Z_PDU(Z_APDU_searchResponse);
+           
+           new_apdu->u.searchResponse->referenceId = sr->referenceId;
+           new_apdu->u.searchResponse->records =
+               create_nonSurrogateDiagnostics(odr_encode(), err, addinfo);
+           *new_apdu->u.searchResponse->searchStatus = 0;
+           
+           send_to_client(new_apdu);
+           
+           return 0;
        }
     }
     else if (apdu->which == Z_APDU_presentRequest)