Temporarily enable full log for access from IP with NIS GROUP client
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 12 Apr 2006 11:55:38 +0000 (11:55 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 12 Apr 2006 11:55:38 +0000 (11:55 +0000)
etc/config.xml
src/yaz-proxy.cpp

index c48eab2..6228571 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
 <?xml version="1.0"?>
-<!-- $Id: config.xml,v 1.19 2006-04-06 16:25:20 adam Exp $ -->
+<!-- $Id: config.xml,v 1.20 2006-04-12 11:55:38 adam Exp $ -->
 <proxy xmlns="http://indexdata.dk/yazproxy/schema/0.9/"
  xmlns:xi="http://www.w3.org/2001/XInclude"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 <proxy xmlns="http://indexdata.dk/yazproxy/schema/0.9/"
  xmlns:xi="http://www.w3.org/2001/XInclude"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -8,16 +8,16 @@
 <!-- Config can be checked with xerces-c++: PParse -n -s config.xml -->
   <target name="localhost" default="1">
     <url>localhost:9999</url>
 <!-- Config can be checked with xerces-c++: PParse -n -s config.xml -->
   <target name="localhost" default="1">
     <url>localhost:9999</url>
-    <target-timeout>30</target-timeout>
-    <client-timeout>60</client-timeout>
-    <target-authentication type="open">a/b</target-authentication>
+    <target-timeout>60</target-timeout>
+    <client-timeout>20</client-timeout>
+    <!-- <target-authentication type="open">a/b</target-authentication> -->
     <keepalive>
     <keepalive>
-      <bandwidth>1000000</bandwidth>
-      <pdu>1000</pdu>
+      <bandwidth>100000</bandwidth>
+      <pdu>100</pdu>
     </keepalive>
     <limit><!-- per minute limits .. -->
       <bandwidth>2000000</bandwidth>
     </keepalive>
     <limit><!-- per minute limits .. -->
       <bandwidth>2000000</bandwidth>
-      <pdu>60</pdu>
+      <pdu>10</pdu>
       <retrieve>100</retrieve>
       <search>3</search>
     </limit>
       <retrieve>100</retrieve>
       <search>3</search>
     </limit>
       <name>dc</name>
     </syntax>
     <syntax type="*" error="238"/>
       <name>dc</name>
     </syntax>
     <syntax type="*" error="238"/>
-    <preinit>0</preinit>
+    <preinit>2</preinit>
     <xi:include href="explain.xml"/>
     <target-charset>iso-8859-1</target-charset>
     <cql2rpn>pqf.properties</cql2rpn>
   </target>
     <xi:include href="explain.xml"/>
     <target-charset>iso-8859-1</target-charset>
     <cql2rpn>pqf.properties</cql2rpn>
   </target>
+<!--
   <target name="*">
     <target-timeout>60</target-timeout>
     <client-timeout>30</client-timeout>
   <target name="*">
     <target-timeout>60</target-timeout>
     <client-timeout>30</client-timeout>
-    <!-- everything else -->
   </target>
   </target>
-  <max-clients>30</max-clients>
-  <max-connect>10</max-connect>
-  <period-connect>10</period-connect>
-  <limit-connect>5</limit-connect>
-  <log>client-requests server-requests client-ip</log>
+-->
+  <max-clients>20</max-clients>
+  <!-- <max-connect>10</max-connect> -->
+  <!-- <period-connect>10</period-connect> -->
+  <!-- <limit-connect>5</limit-connect> -->
+  <log>client-ip</log>
   <docpath>doc</docpath>
 </proxy>
   <docpath>doc</docpath>
 </proxy>
index bf5fa4b..27455b8 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: yaz-proxy.cpp,v 1.53 2006-04-12 11:30:52 adam Exp $
+/* $Id: yaz-proxy.cpp,v 1.54 2006-04-12 11:55:42 adam Exp $
    Copyright (c) 1998-2006, Index Data.
 
 This file is part of the yazproxy.
    Copyright (c) 1998-2006, Index Data.
 
 This file is part of the yazproxy.
@@ -470,8 +470,12 @@ IPDU_Observer *Yaz_Proxy::sessionNotify(IPDU_Observable
     new_proxy->set_default_target(m_default_target);
     new_proxy->m_max_clients = m_max_clients;
     new_proxy->m_log_mask = m_log_mask;
     new_proxy->set_default_target(m_default_target);
     new_proxy->m_max_clients = m_max_clients;
     new_proxy->m_log_mask = m_log_mask;
+
+    if (!strcmp(peername, "tcp:163.121.19.82")) // NIS GROUP
+        new_proxy->m_log_mask = 255;
+
     new_proxy->set_APDU_log(get_APDU_log());
     new_proxy->set_APDU_log(get_APDU_log());
-    if (m_log_mask & PROXY_LOG_APDU_CLIENT)
+    if (new_proxy->m_log_mask & PROXY_LOG_APDU_CLIENT)
         new_proxy->set_APDU_yazlog(1);
     else
         new_proxy->set_APDU_yazlog(0);
         new_proxy->set_APDU_yazlog(1);
     else
         new_proxy->set_APDU_yazlog(0);