client_show_raw_dequeue(cl);
}
-void client_check_preferred_watch(struct client *cl)
-{
- struct session *se = cl->session;
- yaz_log(YLOG_DEBUG, "client_check_preferred_watch: %s ", client_get_id(cl));
- if (se)
- {
- client_unlock(cl);
- /* TODO possible threading issue. Session can have been destroyed */
- if (session_is_preferred_clients_ready(se)) {
- session_alert_watch(se, SESSION_WATCH_SHOW_PREF);
- }
- else
- yaz_log(YLOG_DEBUG, "client_check_preferred_watch: Still locked on preferred targets.");
-
- client_lock(cl);
- }
- else
- yaz_log(YLOG_WARN, "client_check_preferred_watch: %s. No session!", client_get_id(cl));
-
-}
-
struct suggestions* client_suggestions_create(const char* suggestions_string);
static void client_suggestions_destroy(struct client *cl);
struct session *se = cl->session;
if (se)
{
+ client_unlock(cl);
+ /* TODO possible threading issue. Session can have been destroyed */
+ if (session_is_preferred_clients_ready(se))
+ session_alert_watch(se, SESSION_WATCH_SHOW_PREF);
+ client_lock(cl);
if (reclist_get_num_records(se->reclist) > 0)
{
client_unlock(cl);
return 0;
}
+static void ccl_quote_map_term(CCL_bibset ccl_map, WRBUF w,
+ const char *term)
+{
+ int quote_it = 0;
+ const char *cp;
+ for (cp = term; *cp; cp++)
+ if ((*cp >= '0' && *cp <= '9') || strchr(" +-", *cp))
+ ;
+ else
+ quote_it = 1;
+ if (!quote_it)
+ wrbuf_puts(w, term);
+ else
+ {
+ wrbuf_putc(w, '\"');
+ for (cp = term; *cp; cp++)
+ {
+ if (strchr( "\\\"", *cp))
+ wrbuf_putc(w, '\\');
+ wrbuf_putc(w, *cp);
+ }
+ wrbuf_putc(w, '\"');
+ }
+}
+
static int apply_limit(struct session_database *sdb,
facet_limits_t facet_limits,
WRBUF w_pqf, CCL_bibset ccl_map,
struct ccl_rpn_node *cn;
wrbuf_rewind(ccl_w);
wrbuf_puts(ccl_w, ccl);
- wrbuf_puts(ccl_w, "=\"");
- wrbuf_puts(ccl_w, values[i]);
- wrbuf_puts(ccl_w, "\"");
-
+ wrbuf_putc(ccl_w, '=');
+ ccl_quote_map_term(ccl_map, ccl_w, values[i]);
cn = ccl_find_str(ccl_map, wrbuf_cstr(ccl_w),
&cerror, &cpos);
if (cn)