From: Dennis Schafroth Date: Mon, 8 Oct 2012 20:17:58 +0000 (+0200) Subject: Fix: set research flag on new query/limit. More logging. X-Git-Tag: v1.6.22~17 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=e5ec825301f2d26a37f0eab49dda438b78c2d1e3;p=pazpar2-moved-to-github.git Fix: set research flag on new query/limit. More logging. --- diff --git a/src/client.c b/src/client.c index 97be182..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, @@ -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);