summaryrefslogtreecommitdiff
path: root/core/DHT.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-06-25 09:59:54 -0400
committerirungentoo <irungentoo@gmail.com>2013-06-25 09:59:54 -0400
commitbd37e3ad688a9739de1f82d76fde8b61fcd1e9fb (patch)
tree84b358504ff85a269d6ab66e08b669284988c983 /core/DHT.c
parentc93858110bb17ce35143bae7ba9aa68fac93f46b (diff)
Fixed sendnodes and updated readme.
Diffstat (limited to 'core/DHT.c')
-rw-r--r--core/DHT.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/DHT.c b/core/DHT.c
index 37f8b323..7e138beb 100644
--- a/core/DHT.c
+++ b/core/DHT.c
@@ -416,7 +416,7 @@ int sendnodes(IP_Port ip_port, char * client_id, uint32_t ping_id)
416 memcpy(data + 5, self_client_id, CLIENT_ID_SIZE); 416 memcpy(data + 5, self_client_id, CLIENT_ID_SIZE);
417 memcpy(data + 5 + CLIENT_ID_SIZE, nodes_list, num_nodes * (CLIENT_ID_SIZE + sizeof(IP_Port))); 417 memcpy(data + 5 + CLIENT_ID_SIZE, nodes_list, num_nodes * (CLIENT_ID_SIZE + sizeof(IP_Port)));
418 418
419 return sendpacket(ip_port, data, sizeof(data)); 419 return sendpacket(ip_port, data, 5 + CLIENT_ID_SIZE + num_nodes * (CLIENT_ID_SIZE + sizeof(IP_Port)));
420} 420}
421 421
422 422
@@ -463,6 +463,8 @@ int handle_getnodes(char * packet, uint32_t length, IP_Port source)
463 memcpy(&ping_id, packet + 1, 4); 463 memcpy(&ping_id, packet + 1, 4);
464 sendnodes(source, packet + 5 + CLIENT_ID_SIZE, ping_id); 464 sendnodes(source, packet + 5 + CLIENT_ID_SIZE, ping_id);
465 465
466 pingreq(source);
467
466 return 0; 468 return 0;
467} 469}
468 470