From 084185a2c256eb89ff0bd593fa89a702a064f60d Mon Sep 17 00:00:00 2001 From: irungentoo Date: Sun, 14 Jul 2013 11:40:42 -0400 Subject: [PATCH] use DEBUG define to turn on some printfs. --- core/Messenger.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/Messenger.c b/core/Messenger.c index 2e381f81..08acb4e3 100644 --- a/core/Messenger.c +++ b/core/Messenger.c @@ -341,18 +341,24 @@ void doMessenger() uint32_t length; while(receivepacket(&ip_port, data, &length) != -1) { +#ifdef DEBUG //if(rand() % 3 != 1)//simulate packet loss //{ if(DHT_handlepacket(data, length, ip_port) && LosslessUDP_handlepacket(data, length, ip_port)) { //if packet is discarded - //printf("Received unhandled packet with length: %u\n", length); + printf("Received unhandled packet with length: %u\n", length); } else { - //printf("Received handled packet with length: %u\n", length); + printf("Received handled packet with length: %u\n", length); } //} +#else + DHT_handlepacket(data, length, ip_port); + LosslessUDP_handlepacket(data, length, ip_port); +#endif + } doDHT(); doLossless_UDP();