X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=src%2Fclient.c;h=fd1ebc99fa4473c3f4a821e0ccaedafae1f561b7;hb=72d323b0b9aaaa1a5fb06afe8239c9a962b33bac;hp=3627cb9c562462b973a4c6874e9173e37b8fd7ad;hpb=1dc9e0a2543b786610ea5b589e48636fa66b9e3b;p=pazpar2-moved-to-github.git diff --git a/src/client.c b/src/client.c index 3627cb9..fd1ebc9 100644 --- a/src/client.c +++ b/src/client.c @@ -1224,8 +1224,9 @@ static int apply_limit(struct session_database *sdb, } // Parse the query given the settings specific to this client -// return 0 if query is OK but different from before -// return 1 if query is OK but same as before +// client variable same_search is set as below as well as returned: +// 0 if query is OK but different from before +// 1 if query is OK but same as before // return -1 on query error // return -2 on limit error int client_parse_query(struct client *cl, const char *query, @@ -1268,7 +1269,7 @@ int client_parse_query(struct client *cl, const char *query, facet_limits_destroy(cl->facet_limits); cl->facet_limits = facet_limits_dup(facet_limits); - yaz_log(YLOG_LOG, "Client %s: CCL query: %s", client_get_id(cl), wrbuf_cstr(w_ccl)); + yaz_log(YLOG_LOG, "Client %s: CCL query: %s limit: %s", client_get_id(cl), wrbuf_cstr(w_ccl), wrbuf_cstr(w_pqf)); cn = ccl_find_str(ccl_map, wrbuf_cstr(w_ccl), &cerror, &cpos); ccl_qual_rm(&ccl_map); if (!cn) @@ -1307,9 +1308,15 @@ int client_parse_query(struct client *cl, const char *query, /* Compares query and limit with old one. If different we need to research */ if (!cl->pquery || strcmp(cl->pquery, wrbuf_cstr(w_pqf))) { + if (cl->pquery) + session_log(se, YLOG_LOG, "Client %s: Re-search due query/limit change: %s to %s", + client_get_id(cl), cl->pquery, wrbuf_cstr(w_pqf)); xfree(cl->pquery); cl->pquery = xstrdup(wrbuf_cstr(w_pqf)); + // return value is no longer used. ret_value = 0; + // Need to (re)search + cl->same_search= 0; } wrbuf_destroy(w_pqf); @@ -1339,6 +1346,9 @@ int client_parse_query(struct client *cl, const char *query, cl->cqlquery = make_cqlquery(cl, zquery); if (!cl->cqlquery) ret_value = -1; + else + session_log(se, YLOG_LOG, "Client %s native query: %s (%s)", + client_get_id(cl), cl->cqlquery, sru); } } odr_destroy(odr_out);