Made code a bit cleaner
This commit is contained in:
@@ -66,13 +66,13 @@ int call_network(lookup_request* lr, in_addr_t ip, uint16_t port){
|
||||
addr = *((struct sockaddr_in*) servinfo->ai_addr);
|
||||
freeaddrinfo(servinfo);
|
||||
|
||||
// lr->node_ip.s_addr = ntohl(addr.sin_addr.s_addr);
|
||||
// lr->node_port = ntohs(addr.sin_port);
|
||||
|
||||
perror("---CALL_NETWORK---\n");
|
||||
perror("\n\n---CALL_NETWORK---\n");
|
||||
perror("[Deserialized]\n");
|
||||
print_lookup_request(lr);
|
||||
build_lookup_request(lr);
|
||||
print_lookup_request(lr);
|
||||
// perror("[Serialized]\n");
|
||||
// print_lookup_request(lr);
|
||||
fprintf(stderr, "Sending to Port ---> %u\n", port);
|
||||
perror("------------------\n");
|
||||
|
||||
if (sendto(server_socket_udp, lr, sizeof(lookup_request), 0, (struct sockaddr*) &addr, sizeof(struct sockaddr_in)) == -1) {
|
||||
@@ -90,5 +90,5 @@ void clone_lookup_request(lookup_request* dest, lookup_request* source){
|
||||
}
|
||||
|
||||
void print_lookup_request(lookup_request *lr){
|
||||
fprintf(stderr, "LOOKUP_REQUEST:\n\tMessage-type: %u\n\tNode-ID: %u\n\tNode-IP: %s\n\tNode-PORT: %u\n\tHash-ID: %u\n", lr->message_type, lr->node_id, inet_ntoa(lr->node_ip), lr->node_port, lr->hash_id);
|
||||
fprintf(stderr, "LOOKUP_REQUEST:\n\tMessage-type: %d\n\tNode-ID: %u\n\tNode-IP: %s\t(reversed)\n\tNode-PORT: %u\n\tHash-ID: %u\n", lr->message_type, lr->node_id, inet_ntoa(lr->node_ip), lr->node_port, lr->hash_id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user