X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fsession.c;h=72feef6d0fb1d85cd42f92797c57583fc93f1253;hb=3ae3cb006afc68eefad30f1a3f0674e58a74fe5f;hp=fc021a87510c046ca378cc7968077213adce0324;hpb=4d9f530309235e8c78d50f82196f135c3127c064;p=pazpar2-moved-to-github.git diff --git a/src/session.c b/src/session.c index fc021a8..72feef6 100644 --- a/src/session.c +++ b/src/session.c @@ -111,15 +111,17 @@ static int session_use(int delta) no_session_total += delta; sessions = no_sessions; yaz_mutex_leave(g_session_mutex); - yaz_log(YLOG_DEBUG, "%s sesions=%d", delta == 0 ? "" : (delta > 0 ? "INC" : "DEC"), no_sessions); + yaz_log(YLOG_DEBUG, "%s sessions=%d", delta == 0 ? "" : (delta > 0 ? "INC" : "DEC"), no_sessions); return sessions; } -int sessions_count(void) { +int sessions_count(void) +{ return session_use(0); } -int session_count_total(void) { +int session_count_total(void) +{ int total = 0; if (!g_session_mutex) return 0; @@ -129,7 +131,6 @@ int session_count_total(void) { return total; } - static void log_xml_doc(xmlDoc *doc) { FILE *lf = yaz_log_file(); @@ -158,33 +159,6 @@ static void session_leave(struct session *s) yaz_mutex_leave(s->session_mutex); } -// Recursively traverse query structure to extract terms. -void pull_terms(NMEM nmem, struct ccl_rpn_node *n, char **termlist, int *num) -{ - char **words; - int numwords; - int i; - - switch (n->kind) - { - case CCL_RPN_AND: - case CCL_RPN_OR: - case CCL_RPN_NOT: - case CCL_RPN_PROX: - pull_terms(nmem, n->u.p[0], termlist, num); - pull_terms(nmem, n->u.p[1], termlist, num); - break; - case CCL_RPN_TERM: - nmem_strsplit(nmem, " ", n->u.t.term, &words, &numwords); - for (i = 0; i < numwords; i++) - termlist[(*num)++] = words[i]; - break; - default: // NOOP - break; - } -} - - void add_facet(struct session *s, const char *type, const char *value, int count) { struct conf_service *service = s->service; @@ -198,8 +172,6 @@ void add_facet(struct session *s, const char *type, const char *value, int count for (i = 0; i < service->num_metadata; i++) if (!strcmp((service->metadata + i)->name, type)) icu_chain_id = (service->metadata + i)->facetrule; - yaz_log(YLOG_LOG, "icu_chain id=%s", icu_chain_id ? icu_chain_id : "null"); - if (!icu_chain_id) icu_chain_id = "facet"; prt = pp2_charset_token_create(service->charsets, icu_chain_id); @@ -231,8 +203,6 @@ void add_facet(struct session *s, const char *type, const char *value, int count } pp2_charset_token_destroy(prt); - yaz_log(YLOG_LOG, "facet norm=%s", wrbuf_cstr(facet_wrbuf)); - yaz_log(YLOG_LOG, "facet display=%s", wrbuf_cstr(display_wrbuf)); if (wrbuf_len(facet_wrbuf)) { int i;