};
-static const char *http_lookup_header(struct http_header *header,
- const char *name)
+const char *http_lookup_header(struct http_header *header,
+ const char *name)
{
for (; header; header = header->next)
if (!strcasecmp(name, header->name))
void http_close_server(struct conf_server *ser);
void http_addheader(struct http_response *r,
const char *name, const char *value);
+const char *http_lookup_header(struct http_header *header,
+ const char *name);
struct http_header * http_header_append(struct http_channel *ch,
struct http_header * hp,
const char *name,
if (!strcmp(&stylesheets[i][strlen(stylesheets[i])-4], ".xsl"))
{
(*m)->marcmap = NULL;
- if (!((*m)->stylesheet = conf_load_stylesheet(se->service->config, stylesheets[i])))
+ if (!((*m)->stylesheet = conf_load_stylesheet(se->service, stylesheets[i])))
{
yaz_log(YLOG_FATAL|YLOG_ERRNO, "Unable to load stylesheet: %s",
stylesheets[i]);
}
-static struct conf_service *service_init(struct conf_config *config,
+static struct conf_service *service_init(struct conf_server *server,
int num_metadata, int num_sortkeys,
const char *service_id)
{
service->settings = 0;
service->databases = 0;
service->targetprofiles = 0;
- service->config = config;
+ service->server = server;
service->session_timeout = 60; /* default session timeout */
service->z3950_session_timeout = 180;
service->z3950_connect_timeout = 15;
return 0;
}
-static struct conf_service *service_create(struct conf_config *config,
+static struct conf_service *service_create(struct conf_server *server,
xmlNode *node,
const char *service_id)
{
xmlFree(sortkey);
}
- service = service_init(config, num_metadata, num_sortkeys, service_id);
+ service = service_init(server, num_metadata, num_sortkeys, service_id);
for (n = node->children; n; n = n->next)
{
if (src)
{
WRBUF w = wrbuf_alloc();
- conf_dir_path(config, w, (const char *) src);
+ conf_dir_path(server->config, w, (const char *) src);
settings_read_file(service, wrbuf_cstr(w), pass);
wrbuf_destroy(w);
xmlFree(src);
server->myurl = 0;
server->proxy_addr = 0;
server->service = 0;
+ server->config = config;
server->next = 0;
server->relevance_pct = 0;
server->sort_pct = 0;
}
else
{
- struct conf_service *s = service_create(config, n,
+ struct conf_service *s = service_create(server, n,
service_id);
xmlFree(service_id);
if (!s)
return server;
}
-xsltStylesheet *conf_load_stylesheet(struct conf_config *config,
+xsltStylesheet *conf_load_stylesheet(struct conf_service *service,
const char *fname)
{
+ struct conf_config *config = service->server->config;
WRBUF w = wrbuf_alloc();
xsltStylesheet *s;
enum conf_sortkey_type type;
};
+struct conf_server;
+
// It is conceivable that there will eventually be several 'services'
// offered from one server, with separate configuration -- possibly
// more than one services associated with the same port. For now,
struct database *databases;
struct conf_targetprofiles *targetprofiles;
- struct conf_config *config;
+ struct conf_server *server;
};
-struct conf_service * conf_service_create(struct conf_config *config,
- int num_metadata, int num_sortkeys,
- const char *service_id);
-
int conf_service_metadata_field_id(struct conf_service *service, const char * name);
int conf_service_sortkey_field_id(struct conf_service *service, const char * name);
pp2_charset_t mergekey_pct;
struct conf_service *service;
struct conf_server *next;
+ struct conf_config *config;
};
struct conf_targetprofiles
struct conf_config *config_create(const char *fname, int verbose);
void config_destroy(struct conf_config *config);
-xsltStylesheet *conf_load_stylesheet(struct conf_config *config,
+xsltStylesheet *conf_load_stylesheet(struct conf_service *service,
const char *fname);
void config_start_databases(struct conf_config *config);