From d092cafe2c508ad849d49108e99ce6210e92ca51 Mon Sep 17 00:00:00 2001 From: Dennis Schafroth Date: Wed, 11 Apr 2012 16:37:12 +0200 Subject: [PATCH] Writed the filter record count as well into bytarget response --- src/http_command.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/http_command.c b/src/http_command.c index e3c0c69..27edb18 100644 --- a/src/http_command.c +++ b/src/http_command.c @@ -676,7 +676,11 @@ static void bytarget_response(struct http_channel *c, struct http_session *s, co struct hitsbytarget *ht; struct http_request *rq = c->request; const char *settings = http_argbyname(rq, "settings"); - + const char *protocol_version = http_argbyname(rq, "version"); + int version = 0; + if (protocol_version && strcmp(protocol_version,"")) { + version = atoi(protocol_version); + } ht = get_hitsbytarget(s->psession, &count, c->nmem); if (!cmd_status) /* Old protocol, always ok */ @@ -714,8 +718,9 @@ static void bytarget_response(struct http_channel *c, struct http_session *s, co wrbuf_puts(c->wrbuf, "\n"); } - wrbuf_printf(c->wrbuf, "%d\n", ht[i].records); - + wrbuf_printf(c->wrbuf, "%d\n", ht[i].records - ht[i].filtered); + if (version >= 2) + wrbuf_printf(c->wrbuf, "%d\n"); wrbuf_puts(c->wrbuf, ""); wrbuf_xmlputs(c->wrbuf, ht[i].state); wrbuf_puts(c->wrbuf, "\n"); -- 1.7.10.4