Suround by suggestions, if data in suggestions_xml
[pazpar2-moved-to-github.git] / src / http_command.c
index 2f893c8..a86aabb 100644 (file)
@@ -642,6 +642,11 @@ static void cmd_bytarget(struct http_channel *c)
             wrbuf_puts(c->wrbuf, ht[i].settings_xml);
             wrbuf_puts(c->wrbuf, "</settings>\n");
         }
+        if (ht[i].suggestions_xml && ht[i].suggestions_xml[0]) {
+            wrbuf_puts(c->wrbuf, "<suggestions>");
+            wrbuf_puts(c->wrbuf, ht[i].suggestions_xml);
+            wrbuf_puts(c->wrbuf, "</suggestions>");
+        }
         wrbuf_puts(c->wrbuf, "</target>");
     }
     response_close(c, "bytarget");
@@ -1049,7 +1054,6 @@ static void cmd_search(struct http_channel *c)
     }
     response_open(c, "search");
     response_close(c, "search");
-    http_send_response(c);
     release_session(c, s);
 }