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
Make subject part of two tests
[pazpar2-moved-to-github.git]
/
src
/
client.c
diff --git
a/src/client.c
b/src/client.c
index
ea171b9
..
0ae3641
100644
(file)
--- a/
src/client.c
+++ b/
src/client.c
@@
-162,6
+162,11
@@
enum client_state client_get_state(struct client *cl)
return cl->state;
}
return cl->state;
}
+void client_set_state_nb(struct client *cl, enum client_state st)
+{
+ cl->state = st;
+}
+
void client_set_state(struct client *cl, enum client_state st)
{
int was_active = 0;
void client_set_state(struct client *cl, enum client_state st)
{
int was_active = 0;
@@
-983,10
+988,11
@@
static char *make_solrquery(struct client *cl)
return r;
}
return r;
}
-static void apply_limit(struct session_database *sdb,
- facet_limits_t facet_limits,
- WRBUF w_pqf, WRBUF w_ccl)
+static int apply_limit(struct session_database *sdb,
+ facet_limits_t facet_limits,
+ WRBUF w_pqf, WRBUF w_ccl)
{
{
+ int ret = 0;
int i = 0;
const char *name;
const char *value;
int i = 0;
const char *name;
const char *value;
@@
-1038,6
+1044,14
@@
static void apply_limit(struct session_database *sdb,
wrbuf_puts(w_ccl, ")");
}
wrbuf_puts(w_ccl, ")");
}
+ else if (!strncmp(s->value, "local:", 6))
+ ;
+ else
+ {
+ yaz_log(YLOG_WARN, "Target %s: Bad limitmap '%s'",
+ sdb->database->id, s->value);
+ ret = -1; /* bad limitmap */
+ }
break;
}
}
break;
}
}
@@
-1049,6
+1063,7
@@
static void apply_limit(struct session_database *sdb,
}
}
nmem_destroy(nmem_tmp);
}
}
nmem_destroy(nmem_tmp);
+ return ret;
}
// Parse the query given the settings specific to this client
}
// Parse the query given the settings specific to this client
@@
-1094,7
+1109,8
@@
int client_parse_query(struct client *cl, const char *query,
wrbuf_puts(w_pqf, " ");
}
wrbuf_puts(w_pqf, " ");
}
- apply_limit(sdb, facet_limits, w_pqf, w_ccl);
+ if (apply_limit(sdb, facet_limits, w_pqf, w_ccl))
+ return -2;
yaz_log(YLOG_LOG, "CCL query: %s", wrbuf_cstr(w_ccl));
cn = ccl_find_str(ccl_map, wrbuf_cstr(w_ccl), &cerror, &cpos);
yaz_log(YLOG_LOG, "CCL query: %s", wrbuf_cstr(w_ccl));
cn = ccl_find_str(ccl_map, wrbuf_cstr(w_ccl), &cerror, &cpos);