Updated copyright headers. Omit CVS IDs.
[yazproxy-moved-to-github.git] / src / yaz-proxy-config.cpp
index 8325d45..990799a 100644 (file)
@@ -1,7 +1,5 @@
-/* $Id: yaz-proxy-config.cpp,v 1.35 2007-04-12 18:18:42 adam Exp $
-   Copyright (c) 1998-2007, Index Data.
-
-This file is part of the yazproxy.
+/* This file is part of YAZ proxy
+   Copyright (C) 1998-2008 Index Data
 
 YAZ proxy is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
@@ -14,10 +12,9 @@ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 for more details.
 
 You should have received a copy of the GNU General Public License
-along with YAZ proxy; see the file LICENSE.  If not, write to the
-Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
- */
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+*/
 
 #include <ctype.h>
 
@@ -42,6 +39,7 @@ class Yaz_ProxyConfigP {
                             int *limit_bw, int *limit_pdu, int *limit_req,
                             int *limit_search,
                             int *target_idletime, int *client_idletime,
+                            int *max_sockets,
                             int *keepalive_limit_bw, int *keepalive_limit_pdu,
                             int *pre_init, const char **cql2rpn,
                             const char **negotiation_charset,
@@ -231,6 +229,7 @@ void Yaz_ProxyConfigP::return_target_info(xmlNodePtr ptr,
                                           int *limit_search,
                                           int *target_idletime,
                                           int *client_idletime,
+                                          int *max_sockets,
                                           int *keepalive_limit_bw,
                                           int *keepalive_limit_pdu,
                                           int *pre_init,
@@ -297,6 +296,15 @@ void Yaz_ProxyConfigP::return_target_info(xmlNodePtr ptr,
             }
         }
         if (ptr->type == XML_ELEMENT_NODE
+            && !strcmp((const char *) ptr->name, "max-sockets"))
+        {
+            const char *t = get_text(ptr);
+            if (t && max_sockets)
+            {
+                *max_sockets = atoi(t);
+            }
+        }
+        if (ptr->type == XML_ELEMENT_NODE
             && !strcmp((const char *) ptr->name, "cql2rpn"))
         {
             const char *t = get_text(ptr);
@@ -823,7 +831,7 @@ int Yaz_ProxyConfig::check_syntax(ODR odr, const char *name,
                 }
                 else if (syntax)
                 {
-                    int *match_oid 
+                    Odr_oid *match_oid 
                         = yaz_string_to_oid_odr(yaz_oid_std(),
                                                 CLASS_RECSYN, match_type,
                                                 odr);
@@ -880,8 +888,8 @@ int Yaz_ProxyConfig::check_syntax(ODR odr, const char *name,
                         return 25;
                     if (syntax)
                     {
-                        char dotoid_str[100];
-                        oid_to_dotstring(syntax, dotoid_str);
+                        char dotoid_str[OID_STR_MAX];
+                        oid_oid_to_dotstring(syntax, dotoid_str);
                         *addinfo = odr_strdup(odr, dotoid_str);
                     }
                     return atoi(match_error);
@@ -982,6 +990,7 @@ int Yaz_ProxyConfig::get_target_no(int no,
                                    int *limit_search,
                                    int *target_idletime,
                                    int *client_idletime,
+                                   int *max_sockets,
                                    int *max_clients,
                                    int *keepalive_limit_bw,
                                    int *keepalive_limit_pdu,
@@ -1018,6 +1027,7 @@ int Yaz_ProxyConfig::get_target_no(int no,
                     limit_bw, limit_pdu, limit_req,
                     limit_search,
                     target_idletime, client_idletime,
+                    max_sockets,
                     keepalive_limit_bw, keepalive_limit_pdu,
                     pre_init, cql2rpn,
                     negotiation_charset, negotiation_lang, target_charset,
@@ -1297,6 +1307,7 @@ void Yaz_ProxyConfig::get_target_info(const char *name,
                                       int *limit_search,
                                       int *target_idletime,
                                       int *client_idletime,
+                                      int *max_sockets,
                                       int *max_clients,
                                       int *keepalive_limit_bw,
                                       int *keepalive_limit_pdu,
@@ -1341,6 +1352,7 @@ void Yaz_ProxyConfig::get_target_info(const char *name,
         m_cp->return_target_info(ptr, url, limit_bw, limit_pdu, limit_req,
                                  limit_search,
                                  target_idletime, client_idletime,
+                                 max_sockets,
                                  keepalive_limit_bw, keepalive_limit_pdu,
                                  pre_init, cql2rpn,
                                  negotiation_charset, negotiation_lang,