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
Add mutex for service (ref counting)
[pazpar2-moved-to-github.git]
/
src
/
logic.c
diff --git
a/src/logic.c
b/src/logic.c
index
c07d303
..
0180c27
100644
(file)
--- a/
src/logic.c
+++ b/
src/logic.c
@@
-1,5
+1,5
@@
/* This file is part of Pazpar2.
/* This file is part of Pazpar2.
- Copyright (C) 2006-2009 Index Data
+ Copyright (C) 2006-2010 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
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
@@
-92,7
+92,7
@@
static void log_xml_doc(xmlDoc *doc)
#endif
if (lf && len)
{
#endif
if (lf && len)
{
- fwrite(result, 1, len, lf);
+ (void) fwrite(result, 1, len, lf);
fprintf(lf, "\n");
}
xmlFree(result);
fprintf(lf, "\n");
}
xmlFree(result);
@@
-719,7
+719,7
@@
struct record_cluster *show_single(struct session *s, const char *id,
}
struct record_cluster **show(struct session *s, struct reclist_sortparms *sp,
}
struct record_cluster **show(struct session *s, struct reclist_sortparms *sp,
- int start, int *num, int *total, int *sumhits,
+ int start, int *num, int *total, Odr_int *sumhits,
NMEM nmem_show)
{
struct record_cluster **recs = nmem_malloc(nmem_show, *num
NMEM nmem_show)
{
struct record_cluster **recs = nmem_malloc(nmem_show, *num
@@
-808,17
+808,23
@@
void statistics(struct session *se, struct statistics *stat)
// Master list of connections we're handling events to
// Master list of connections we're handling events to
-static IOCHAN channel_list = 0; /* thread pr */
+static iochan_man_t pazpar2_chan_man = 0; /* thread pr */
+
+void pazpar2_chan_man_start(int no_threads)
+{
+ pazpar2_chan_man = iochan_man_create(no_threads);
+}
void pazpar2_add_channel(IOCHAN chan)
{
void pazpar2_add_channel(IOCHAN chan)
{
- chan->next = channel_list;
- channel_list = chan;
+ assert(pazpar2_chan_man);
+ iochan_add(pazpar2_chan_man, chan);
}
void pazpar2_event_loop()
{
}
void pazpar2_event_loop()
{
- event_loop(&channel_list);
+ assert(pazpar2_chan_man);
+ iochan_man_events(pazpar2_chan_man);
}
static struct record_metadata *record_metadata_init(
}
static struct record_metadata *record_metadata_init(
@@
-897,15
+903,15
@@
static int get_mergekey_from_doc(xmlDoc *doc, xmlNode *root, const char *name,
service->mergekey_pct,
(const char *) value, 0);
service->mergekey_pct,
(const char *) value, 0);
+ if (wrbuf_len(norm_wr) > 0)
+ wrbuf_puts(norm_wr, " ");
wrbuf_puts(norm_wr, name);
wrbuf_puts(norm_wr, name);
- wrbuf_puts(norm_wr, "=");
while ((norm_str =
pp2_relevance_token_next(prt)))
{
if (*norm_str)
{
while ((norm_str =
pp2_relevance_token_next(prt)))
{
if (*norm_str)
{
- if (wrbuf_len(norm_wr))
- wrbuf_puts(norm_wr, " ");
+ wrbuf_puts(norm_wr, " ");
wrbuf_puts(norm_wr, norm_str);
}
}
wrbuf_puts(norm_wr, norm_str);
}
}