projects
/
pazpar2-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
hmm, added twice.
[pazpar2-moved-to-github.git]
/
src
/
pazpar2_config.c
diff --git
a/src/pazpar2_config.c
b/src/pazpar2_config.c
index
4930f73
..
ec87caf
100644
(file)
--- a/
src/pazpar2_config.c
+++ b/
src/pazpar2_config.c
@@
-38,6
+38,7
@@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
+#include "ppmutex.h"
#include "incref.h"
#include "pazpar2_config.h"
#include "settings.h"
#include "incref.h"
#include "pazpar2_config.h"
#include "settings.h"
@@
-52,6
+53,7
@@
struct conf_config
int no_threads;
WRBUF confdir;
iochan_man_t iochan_man;
int no_threads;
WRBUF confdir;
iochan_man_t iochan_man;
+ database_hosts_t database_hosts;
};
};
@@
-696,7
+698,7
@@
struct conf_service *service_create(struct conf_server *server,
inherit_server_settings(service);
resolve_databases(service);
assert(service->mutex == 0);
inherit_server_settings(service);
resolve_databases(service);
assert(service->mutex == 0);
- yaz_mutex_create(&service->mutex);
+ pazpar2_mutex_create(&service->mutex, "conf");
}
return service;
}
}
return service;
}
@@
-722,6
+724,7
@@
static struct conf_server *server_create(struct conf_config *config,
server->server_settings = 0;
server->http_server = 0;
server->iochan_man = 0;
server->server_settings = 0;
server->http_server = 0;
server->iochan_man = 0;
+ server->database_hosts = 0;
if (server_id)
{
if (server_id)
{
@@
-837,9
+840,8
@@
static struct conf_server *server_create(struct conf_config *config,
return server;
}
return server;
}
-WRBUF conf_get_fname(struct conf_service *service, const char *fname)
+WRBUF conf_get_fname(struct conf_config *config, const char *fname)
{
{
- struct conf_config *config = service->server->config;
WRBUF w = wrbuf_alloc();
conf_dir_path(config, w, fname);
WRBUF w = wrbuf_alloc();
conf_dir_path(config, w, fname);
@@
-1022,12
+1024,15
@@
void config_destroy(struct conf_config *config)
if (config)
{
struct conf_server *server = config->servers;
if (config)
{
struct conf_server *server = config->servers;
+ iochan_man_destroy(&config->iochan_man);
while (server)
{
struct conf_server *s_next = server->next;
server_destroy(server);
server = s_next;
}
while (server)
{
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);
}
wrbuf_destroy(config->confdir);
nmem_destroy(config->nmem);
}
@@
-1043,14
+1048,19
@@
void config_stop_listeners(struct conf_config *conf)
void config_process_events(struct conf_config *conf)
{
struct conf_server *ser;
void config_process_events(struct conf_config *conf)
{
struct conf_server *ser;
+
+ conf->database_hosts = database_hosts_create();
for (ser = conf->servers; ser; ser = ser->next)
{
struct conf_service *s = ser->service;
for (ser = conf->servers; ser; ser = ser->next)
{
struct conf_service *s = ser->service;
+
+ ser->database_hosts = conf->database_hosts;
+
for (;s ; s = s->next)
{
resolve_databases(s);
assert(s->mutex == 0);
for (;s ; s = s->next)
{
resolve_databases(s);
assert(s->mutex == 0);
- yaz_mutex_create(&s->mutex);
+ pazpar2_mutex_create(&s->mutex, "service");
}
http_mutex_init(ser);
}
}
http_mutex_init(ser);
}