diff options
author | irungentoo <irungentoo@gmail.com> | 2013-07-14 11:40:42 -0400 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2013-07-14 11:40:42 -0400 |
commit | 084185a2c256eb89ff0bd593fa89a702a064f60d (patch) | |
tree | 2634217c091eff8b735027d906ae645f04c63c67 | |
parent | 71abd15c1b71836d35af5398fcc6b416baad73d3 (diff) |
use DEBUG define to turn on some printfs.
-rw-r--r-- | core/Messenger.c | 10 |
1 files 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() | |||
341 | uint32_t length; | 341 | uint32_t length; |
342 | while(receivepacket(&ip_port, data, &length) != -1) | 342 | while(receivepacket(&ip_port, data, &length) != -1) |
343 | { | 343 | { |
344 | #ifdef DEBUG | ||
344 | //if(rand() % 3 != 1)//simulate packet loss | 345 | //if(rand() % 3 != 1)//simulate packet loss |
345 | //{ | 346 | //{ |
346 | if(DHT_handlepacket(data, length, ip_port) && LosslessUDP_handlepacket(data, length, ip_port)) | 347 | if(DHT_handlepacket(data, length, ip_port) && LosslessUDP_handlepacket(data, length, ip_port)) |
347 | { | 348 | { |
348 | //if packet is discarded | 349 | //if packet is discarded |
349 | //printf("Received unhandled packet with length: %u\n", length); | 350 | printf("Received unhandled packet with length: %u\n", length); |
350 | } | 351 | } |
351 | else | 352 | else |
352 | { | 353 | { |
353 | //printf("Received handled packet with length: %u\n", length); | 354 | printf("Received handled packet with length: %u\n", length); |
354 | } | 355 | } |
355 | //} | 356 | //} |
357 | #else | ||
358 | DHT_handlepacket(data, length, ip_port); | ||
359 | LosslessUDP_handlepacket(data, length, ip_port); | ||
360 | #endif | ||
361 | |||
356 | } | 362 | } |
357 | doDHT(); | 363 | doDHT(); |
358 | doLossless_UDP(); | 364 | doLossless_UDP(); |