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();