mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
use DEBUG define to turn on some printfs.
This commit is contained in:
parent
71abd15c1b
commit
084185a2c2
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue
Block a user