Disable extra logging for particular client IP
[yazproxy-moved-to-github.git] / src / yaz-proxy.cpp
index 3ec98a1..5b05b41 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: yaz-proxy.cpp,v 1.62 2006-04-26 11:59:11 adam Exp $
+/* $Id: yaz-proxy.cpp,v 1.66 2006-05-01 09:15:52 adam Exp $
    Copyright (c) 1998-2006, Index Data.
 
 This file is part of the yazproxy.
@@ -452,9 +452,13 @@ 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->m_session_no = m_session_no;
 
+#if 0
+    // in case we want to watch a particular client..
     if (!strcmp(peername, "tcp:163.121.19.82")) // NIS GROUP
         new_proxy->m_log_mask = 255;
+#endif
 
     new_proxy->set_APDU_log(get_APDU_log());
     if (new_proxy->m_log_mask & PROXY_LOG_APDU_CLIENT)
@@ -601,8 +605,14 @@ Yaz_ProxyClient *Yaz_Proxy::get_client(Z_APDU *apdu, const char *cookie,
             m_client_idletime = client_idletime;
             timeout(m_client_idletime);
         }
+
+        // get those FILE descriptors available 
+        m_parent->low_socket_close();
         if (cql2rpn_fname)
             m_cql2rpn.set_pqf_file(cql2rpn_fname);
+        // reserve them again
+        m_parent->low_socket_open();
+        
         if (negotiation_charset || negotiation_lang || default_client_query_charset)
         {
             set_proxy_negotiation(negotiation_charset,
@@ -3122,8 +3132,9 @@ void Yaz_Proxy::handle_init(Z_APDU *apdu)
 
             handle_charset_lang_negotiation(apdu2);
 
+           if (m_timeout_mode == timeout_busy)
+               m_timeout_mode = timeout_normal;
             send_to_client(apdu2);
-            m_timeout_mode = timeout_normal;
             return;
         }
     }
@@ -3691,7 +3702,9 @@ void Yaz_ProxyClient::recv_Z_PDU(Z_APDU *apdu, int len)
         *imv1 = '\0';
         if (imv0)
             strcat(imv1, imv0);
+#ifdef VERSION
         strcat(imv1, "/" VERSION);
+#endif
         ir->implementationVersion = imv1;
         
         // apply YAZ Proxy implementation name