X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fsettings.c;h=98adae9e1b5aa786e6d44e7145979da809aa13ce;hb=75c525dda08ff50e17f262f58a44dbda873fa6a5;hp=db5d7cebeb455fddbb6453d3a1d0b419209e9992;hpb=f5c357bcf6a21cec50d5938d91f50f49953e0002;p=pazpar2-moved-to-github.git diff --git a/src/settings.c b/src/settings.c index db5d7ce..98adae9 100644 --- a/src/settings.c +++ b/src/settings.c @@ -1,5 +1,5 @@ /* This file is part of Pazpar2. - Copyright (C) 2006-2009 Index Data + Copyright (C) 2006-2011 Index Data Pazpar2 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 @@ -31,7 +31,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #include #include -#include "direntz.h" +#include #include #include @@ -41,7 +41,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #include -#include "pazpar2.h" +#include "session.h" #include "database.h" #include "settings.h" @@ -59,7 +59,6 @@ static char *hard_settings[] = { "pz:id", "pz:name", "pz:queryencoding", - "pz:ip", "pz:zproxy", "pz:apdulog", "pz:sru", @@ -67,6 +66,18 @@ static char *hard_settings[] = { "pz:pqf_prefix", "pz:sort", "pz:recordfilter", + "pz:pqf_strftime", + "pz:negotiation_charset", + "pz:max_connections", + "pz:reuse_connections", + "pz:termlist_term_factor", + "pz:preferred", + "pz:extra_args", + "pz:query_syntax", + "pz:facetmap:", + "pz:limitmap:", + "pz:url", + "pz:sortmap:", 0 }; @@ -324,7 +335,7 @@ void expand_settings_array(struct setting ***set_ar, int *num, int offset, // This is called from grep_databases -- adds/overrides setting for a target // This is also where the rules for precedence of settings are implemented -static void update_database(void *context, struct database *db) +static void update_database_fun(void *context, struct database *db) { struct setting *set = ((struct update_database_context *) context)->set; @@ -334,7 +345,7 @@ static void update_database(void *context, struct database *db) int offset; // Is this the right database? - if (!match_zurl(db->url, set->target)) + if (!match_zurl(db->id, set->target)) return; offset = settings_create_offset(service, set->name); @@ -392,7 +403,7 @@ static void update_databases(void *client_data, struct setting *set) struct update_database_context context; context.set = set; context.service = service; - predef_grep_databases(&context, service, update_database); + predef_grep_databases(&context, service, update_database_fun); } // This simply copies the 'hard' (application-specific) settings @@ -426,22 +437,10 @@ static void initialize_soft_settings(struct conf_service *service) static void prepare_target_dictionary(void *client_data, struct setting *set) { struct conf_service *service = (struct conf_service *) client_data; - struct setting_dictionary *dictionary = service->dictionary; - - int i; - char *p; // If target address is not wildcard, add the database if (*set->target && !zurl_wildcard(set->target)) - find_database(set->target, service); - - // Determine if we already have a dictionary entry - if (!strncmp(set->name, "pz:", 3) && (p = strchr(set->name + 3, ':'))) - *(p + 1) = '\0'; - for (i = 0; i < dictionary->num; i++) - if (!strcmp(dictionary->dict[i], set->name)) - return; - yaz_log(YLOG_WARN, "Setting '%s' not configured as metadata", set->name); + create_database_for_service(set->target, service); } void init_settings(struct conf_service *service)