From 8a6d1f13b7680bc8f15ce57b8065a9bc774aa891 Mon Sep 17 00:00:00 2001 From: deva Date: Wed, 11 Feb 2009 10:04:09 +0000 Subject: Changed all printf debug outputs to new debug interface (PRACRO_DEBUG and friends). --- server/src/queryhandlerpentominos.cc | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'server/src/queryhandlerpentominos.cc') diff --git a/server/src/queryhandlerpentominos.cc b/server/src/queryhandlerpentominos.cc index 4b98768..9d39407 100644 --- a/server/src/queryhandlerpentominos.cc +++ b/server/src/queryhandlerpentominos.cc @@ -26,6 +26,8 @@ */ #include "queryhandlerpentominos.h" +#include "debug.h" + #include // For time @@ -63,7 +65,6 @@ typedef struct { unsigned short int count; } UID; - #define SIOCGIFCONF 0x8912 // get iface list static in_addr_t getIP(const char *interface) @@ -157,9 +158,7 @@ QueryResult QueryHandlerPentominos::exec(Query &query) socket->write(header, strlen(header)); #endif/*WITHOUT_PENTOMINOS*/ -#ifdef WITH_DEBUG - printf(header); -#endif/*WITH_DEBUG*/ + PRACRO_DEBUG(queryhandler, header); sprintf(buf, " write(buf, strlen(buf)); #endif/*WITHOUT_PENTOMINOS*/ -#ifdef WITH_DEBUG - printf(buf); -#endif/*WITH_DEBUG*/ + PRACRO_DEBUG(queryhandler, buf); sprintf(buf, " write(buf, strlen(buf)); #endif/*WITHOUT_PENTOMINOS*/ -#ifdef WITH_DEBUG - printf(buf); -#endif/*WITH_DEBUG*/ + PRACRO_DEBUG(queryhandler, buf); sprintf(buf, ""); @@ -206,10 +201,7 @@ QueryResult QueryHandlerPentominos::exec(Query &query) socket->write(buf, strlen(buf)); #endif/*WITHOUT_PENTOMINOS*/ -#ifdef WITH_DEBUG - printf(buf); - fflush(stdout); -#endif/*WITH_DEBUG*/ + PRACRO_DEBUG(queryhandler, buf); QueryResult result; @@ -220,14 +212,14 @@ QueryResult QueryHandlerPentominos::exec(Query &query) // Read until we've got the entire result. while((size = socket->read(buf, sizeof(buf))) > 0) { - fwrite(buf, size, 1, stdout); fflush(stdout); + // fwrite(buf, size, 1, stdout); fflush(stdout); if(parser.parse(buf, size)) break; } result = parser.result; #endif/*WITHOUT_PENTOMINOS*/ - printf("Done handling query\n"); + PRACRO_INFO(queryhandler, "Done handling query\n"); result.print(); -- cgit v1.2.3