diff options
author | deva <deva> | 2008-08-08 09:23:03 +0000 |
---|---|---|
committer | deva <deva> | 2008-08-08 09:23:03 +0000 |
commit | b7be78948cad7629427fd19769ddcfdfea3fb666 (patch) | |
tree | 172c4f213ae481ffb80dd31c9dd45d52920e4d73 /server/src/queryhandler.cc | |
parent | 817402b5208b0dbc92a64ed094a936c56c8c1e49 (diff) |
Added print debug configurable.
Diffstat (limited to 'server/src/queryhandler.cc')
-rw-r--r-- | server/src/queryhandler.cc | 26 |
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 |