mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
commit
383630b3d4
|
@ -346,11 +346,11 @@ void doMessenger()
|
|||
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);
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ void new_lines(char *line)
|
|||
strcpy(lines[i],lines[i-1]);
|
||||
}
|
||||
strcpy(lines[0],line);
|
||||
do_refresh();
|
||||
}
|
||||
|
||||
unsigned char * hex_string_to_bin(char hex_string[])
|
||||
|
@ -65,7 +66,7 @@ void line_eval(char lines[HISTORY][STRING_LENGTH], char *line)
|
|||
strcat(command, line);
|
||||
new_lines(command);
|
||||
} else {
|
||||
new_lines(line);
|
||||
//new_lines(line);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -186,8 +187,10 @@ int main(int argc, char *argv[])
|
|||
bootstrap_ip_port.port = htons(atoi(argv[2]));
|
||||
bootstrap_ip_port.ip.i = inet_addr(argv[1]);
|
||||
DHT_bootstrap(bootstrap_ip_port, hex_string_to_bin(argv[3]));
|
||||
nodelay(stdscr, TRUE);
|
||||
while(true) {
|
||||
c=getch();
|
||||
if (c != ERR) {
|
||||
if (c != 27) {
|
||||
getmaxyx(stdscr,y,x);
|
||||
if (c == '\n') {
|
||||
|
@ -198,6 +201,9 @@ int main(int argc, char *argv[])
|
|||
} else if (isalnum(c) || ispunct(c) || c == ' ') {
|
||||
strcpy(line,appender(line, (char) c));
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
doMessenger();
|
||||
do_refresh();
|
||||
|
|
Loading…
Reference in New Issue
Block a user