Discover lost connections immediately
[pazpar2-moved-to-github.git] / src / pazpar2_config.c
index 3b9d47a..8862123 100644 (file)
@@ -55,7 +55,6 @@ struct conf_config
     int no_threads;
     WRBUF confdir;
     iochan_man_t iochan_man;
-    database_hosts_t database_hosts;
 };
 
 struct service_xslt
@@ -513,7 +512,7 @@ static int parse_metadata(struct conf_service *service, xmlNode *n,
 }
 
 
-static void service_add_metadata(xmlNode *n, int *num_metadata, int *num_sortkeys)
+static void count_metadata(xmlNode *n, int *num_metadata, int *num_sortkeys)
 {
     xmlChar *sortkey = xmlGetProp(n, (xmlChar *) "sortkey");
     (*num_metadata)++;
@@ -549,11 +548,11 @@ static struct conf_service *service_create_static(struct conf_server *server,
                 {
                     if (m->type == XML_ELEMENT_NODE &&
                             !strcmp((const char *) m->name, "metadata"))
-                        service_add_metadata(m, &num_metadata, &num_sortkeys);
+                        count_metadata(m, &num_metadata, &num_sortkeys);
                 }
             }
             else // This is a metadata-element proper, count it right away.
-                service_add_metadata(n, &num_metadata, &num_sortkeys);
+                count_metadata(n, &num_metadata, &num_sortkeys);
         }
 
     service = service_init(server, num_metadata, num_sortkeys, service_id);
@@ -639,14 +638,9 @@ static struct conf_service *service_create_static(struct conf_server *server,
                  || !strcmp((const char *) n->name, "facet"))
 
         {
-            if (!service->charsets)
-                service->charsets = pp2_charset_fact_create();
-            if (pp2_charset_fact_define(service->charsets,
-                                        n->children, (const char *) n->name))
-            {
-                yaz_log(YLOG_FATAL, "ICU chain definition error");
-                return 0;
-            }
+            yaz_log(YLOG_FATAL, "No longer supported: <%s>", n->name);
+            yaz_log(YLOG_LOG, "Use <icu_chain id=\"%s\">.. instead", n->name);
+            return 0;
         }
         else if (!strcmp((const char *) n->name, (const char *) "metadata"))
         {
@@ -680,7 +674,7 @@ static struct conf_service *service_create_static(struct conf_server *server,
                     service->rank_cluster = 1;
                 else if (!strcmp(rank_cluster, "no"))
                     service->rank_cluster = 0;
-                else 
+                else
                 {
                     yaz_log(YLOG_FATAL, "service: rank@cluster boolean");
                     return 0;
@@ -864,7 +858,6 @@ static struct conf_server *server_create(struct conf_config *config,
     server->charsets = 0;
     server->http_server = 0;
     server->iochan_man = 0;
-    server->database_hosts = config->database_hosts;
     server->settings_fname = 0;
 
     if (server_id)
@@ -942,14 +935,9 @@ static struct conf_server *server_create(struct conf_config *config,
                  || !strcmp((const char *) n->name, "mergekey")
                  || !strcmp((const char *) n->name, "facet"))
         {
-            if (!server->charsets)
-                server->charsets = pp2_charset_fact_create();
-            if (pp2_charset_fact_define(server->charsets,
-                                        n->children, (const char *) n->name))
-            {
-                yaz_log(YLOG_FATAL, "ICU chain definition error");
-                return 0;
-            }
+            yaz_log(YLOG_FATAL, "No longer supported: <%s>", n->name);
+            yaz_log(YLOG_LOG, "Use <icu_chain id=\"%s\">.. instead", n->name);
+            return 0;
         }
         else if (!strcmp((const char *) n->name, "service"))
         {
@@ -1263,8 +1251,8 @@ struct conf_config *config_create(const char *fname, int verbose)
 {
     xmlDoc *doc = xmlReadFile(fname,
                               NULL,
-                              XML_PARSE_XINCLUDE + XML_PARSE_NOBLANKS
-                              + XML_PARSE_NSCLEAN + XML_PARSE_NONET );
+                              XML_PARSE_XINCLUDE
+                              + XML_PARSE_NSCLEAN + XML_PARSE_NONET);
     xmlNode *n;
     const char *p;
     int r;
@@ -1292,7 +1280,6 @@ struct conf_config *config_create(const char *fname, int verbose)
     config->servers = 0;
     config->no_threads = 0;
     config->iochan_man = 0;
-    config->database_hosts = database_hosts_create();
 
     config->confdir = wrbuf_alloc();
     if ((p = strrchr(fname,
@@ -1358,7 +1345,6 @@ void config_destroy(struct conf_config *config)
             struct conf_server *s_next = server->next;
             server_destroy(server);
             server = s_next;
-            database_hosts_destroy(&config->database_hosts);
         }
         wrbuf_destroy(config->confdir);
         nmem_destroy(config->nmem);