tabs -> spaces

This commit is contained in:
slvr 2013-08-10 11:18:25 +01:00
parent 8f6f8e221d
commit 7f27fcaf37
8 changed files with 34 additions and 34 deletions

View File

@ -1076,11 +1076,11 @@ static void doNAT(void)
void DHT_init(void)
{
networking_registerhandler(0, &handle_ping_request);
networking_registerhandler(1, &handle_ping_response);
networking_registerhandler(2, &handle_getnodes);
networking_registerhandler(3, &handle_sendnodes);
networking_registerhandler(254, &handle_NATping);
networking_registerhandler(0, &handle_ping_request);
networking_registerhandler(1, &handle_ping_response);
networking_registerhandler(2, &handle_getnodes);
networking_registerhandler(3, &handle_sendnodes);
networking_registerhandler(254, &handle_NATping);
}
void doDHT(void)

View File

@ -134,5 +134,5 @@ int send_LANdiscovery(uint16_t port)
void LANdiscovery_init(void)
{
networking_registerhandler(33, &handle_LANdiscovery);
networking_registerhandler(33, &handle_LANdiscovery);
}

View File

@ -772,9 +772,9 @@ static int handle_data(IP_Port source, uint8_t *packet, uint32_t length)
void LosslessUDP_init(void)
{
networking_registerhandler(16, &handle_handshake);
networking_registerhandler(17, &handle_SYNC);
networking_registerhandler(18, &handle_data);
networking_registerhandler(16, &handle_handshake);
networking_registerhandler(17, &handle_SYNC);
networking_registerhandler(18, &handle_data);
}
/*

View File

@ -517,10 +517,10 @@ int initMessenger(void)
if(init_networking(ip,PORT) == -1)
return -1;
DHT_init();
LosslessUDP_init();
friendreq_init();
LANdiscovery_init();
DHT_init();
LosslessUDP_init();
friendreq_init();
LANdiscovery_init();
return 0;
}
@ -688,14 +688,14 @@ static void LANdiscovery(void)
/* the main loop that needs to be run at least 200 times per second. */
void doMessenger(void)
{
networking_poll();
networking_poll();
doDHT();
doLossless_UDP();
doNetCrypto();
doInbound();
doFriends();
LANdiscovery();
doDHT();
doLossless_UDP();
doNetCrypto();
doInbound();
doFriends();
LANdiscovery();
}
/* returns the size of the messenger data (for saving) */

View File

@ -132,5 +132,5 @@ static int friendreq_handlepacket(IP_Port source, uint8_t * packet, uint32_t len
void friendreq_init(void)
{
networking_registerhandler(32, &friendreq_handlepacket);
networking_registerhandler(32, &friendreq_handlepacket);
}

View File

@ -92,21 +92,21 @@ static packet_handler_callback packethandlers[256] = {0};
void networking_registerhandler(uint8_t byte, packet_handler_callback cb)
{
packethandlers[byte] = cb;
packethandlers[byte] = cb;
}
void networking_poll()
{
IP_Port ip_port;
uint8_t data[MAX_UDP_PACKET_SIZE];
uint32_t length;
while (receivepacket(&ip_port, data, &length) != -1)
{
if (length < 1) continue;
if (!packethandlers[data[0]]) continue;
packethandlers[data[0]](ip_port, data, length);
}
IP_Port ip_port;
uint8_t data[MAX_UDP_PACKET_SIZE];
uint32_t length;
while (receivepacket(&ip_port, data, &length) != -1)
{
if (length < 1) continue;
if (!packethandlers[data[0]]) continue;
packethandlers[data[0]](ip_port, data, length);
}
}
/* initialize networking

View File

@ -136,7 +136,7 @@ void Lossless_UDP()
/* } */
/* }*/
networking_poll();
networking_poll();
doLossless_UDP();

View File

@ -132,7 +132,7 @@ void Lossless_UDP()
//}
// }
networking_poll();
networking_poll();
doLossless_UDP();
}