summaryrefslogtreecommitdiff
path: root/server/src/queryhandler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/queryhandler.cc')
-rw-r--r--server/src/queryhandler.cc26
1 files changed, 18 insertions, 8 deletions
diff --git a/server/src/queryhandler.cc b/server/src/queryhandler.cc
index 573ce3a..29e8fda 100644
--- a/server/src/queryhandler.cc
+++ b/server/src/queryhandler.cc
@@ -26,6 +26,8 @@
*/
#include "queryhandler.h"
+#include <config.h>
+
// For time
#include <time.h>
@@ -155,10 +157,12 @@ std::string QueryHandler::exec()
" xsi:schemaLocation=\"http://www.aasimon.org/pentominos schema.xsd\">\n";
#ifndef WITHOUT_PENTOMINOS
socket->write(header, strlen(header));
-#else
- printf(header);
#endif/*WITHOUT_PENTOMINOS*/
+#ifdef WITH_DEBUG
+ printf(header);
+#endif/*WITH_DEBUG*/
+
sprintf(buf, " <pentominos:entry cpr=\"%s\"\n"
" src_addr=\"%s\"\n"
" dst_addr=\"%s\"\n"
@@ -176,10 +180,12 @@ std::string QueryHandler::exec()
uid.c_str());
#ifndef WITHOUT_PENTOMINOS
socket->write(buf, strlen(buf));
-#else
- printf(buf);
#endif/*WITHOUT_PENTOMINOS*/
+#ifdef WITH_DEBUG
+ printf(buf);
+#endif/*WITH_DEBUG*/
+
std::vector< Query >::iterator j = queries.begin();
while(j != queries.end()) {
Query query = *j;
@@ -194,10 +200,12 @@ std::string QueryHandler::exec()
#ifndef WITHOUT_PENTOMINOS
socket->write(buf, strlen(buf));
-#else
- printf(buf);
#endif/*WITHOUT_PENTOMINOS*/
+#ifdef WITH_DEBUG
+ printf(buf);
+#endif/*WITH_DEBUG*/
+
j++;
}
@@ -208,10 +216,12 @@ std::string QueryHandler::exec()
// Terminate
char term[] = "\0";
socket->write(term, 1);
-#else
- printf(buf);
#endif/*WITHOUT_PENTOMINOS*/
+#ifdef WITH_DEBUG
+ printf(buf);
+#endif/*WITH_DEBUG*/
+
std::string answer;
#ifndef WITHOUT_PENTOMINOS