summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/Messenger.c4
-rw-r--r--testing/nTox.c26
2 files changed, 18 insertions, 12 deletions
diff --git a/core/Messenger.c b/core/Messenger.c
index cc22a7f5..37e369fa 100644
--- a/core/Messenger.c
+++ b/core/Messenger.c
@@ -346,11 +346,11 @@ void doMessenger()
346 if(DHT_handlepacket(data, length, ip_port) && LosslessUDP_handlepacket(data, length, ip_port)) 346 if(DHT_handlepacket(data, length, ip_port) && LosslessUDP_handlepacket(data, length, ip_port))
347 { 347 {
348 //if packet is discarded 348 //if packet is discarded
349 printf("Received unhandled packet with length: %u\n", length); 349 //printf("Received unhandled packet with length: %u\n", length);
350 } 350 }
351 else 351 else
352 { 352 {
353 printf("Received handled packet with length: %u\n", length); 353 //printf("Received handled packet with length: %u\n", length);
354 } 354 }
355 //} 355 //}
356 } 356 }
diff --git a/testing/nTox.c b/testing/nTox.c
index de37b6f7..b2ac6a71 100644
--- a/testing/nTox.c
+++ b/testing/nTox.c
@@ -10,6 +10,7 @@ void new_lines(char *line)
10 strcpy(lines[i],lines[i-1]); 10 strcpy(lines[i],lines[i-1]);
11 } 11 }
12 strcpy(lines[0],line); 12 strcpy(lines[0],line);
13 do_refresh();
13} 14}
14 15
15unsigned char * hex_string_to_bin(char hex_string[]) 16unsigned char * hex_string_to_bin(char hex_string[])
@@ -65,7 +66,7 @@ void line_eval(char lines[HISTORY][STRING_LENGTH], char *line)
65 strcat(command, line); 66 strcat(command, line);
66 new_lines(command); 67 new_lines(command);
67 } else { 68 } else {
68 new_lines(line); 69 //new_lines(line);
69 } 70 }
70} 71}
71 72
@@ -186,17 +187,22 @@ int main(int argc, char *argv[])
186 bootstrap_ip_port.port = htons(atoi(argv[2])); 187 bootstrap_ip_port.port = htons(atoi(argv[2]));
187 bootstrap_ip_port.ip.i = inet_addr(argv[1]); 188 bootstrap_ip_port.ip.i = inet_addr(argv[1]);
188 DHT_bootstrap(bootstrap_ip_port, hex_string_to_bin(argv[3])); 189 DHT_bootstrap(bootstrap_ip_port, hex_string_to_bin(argv[3]));
190 nodelay(stdscr, TRUE);
189 while(true) { 191 while(true) {
190 c=getch(); 192 c=getch();
191 if (c != 27) { 193 if (c != ERR) {
192 getmaxyx(stdscr,y,x); 194 if (c != 27) {
193 if (c == '\n') { 195 getmaxyx(stdscr,y,x);
194 line_eval(lines, line); 196 if (c == '\n') {
195 strcpy(line, ""); 197 line_eval(lines, line);
196 } else if (c == 127) { 198 strcpy(line, "");
197 line[strlen(line)-1] = '\0'; 199 } else if (c == 127) {
198 } else if (isalnum(c) || ispunct(c) || c == ' ') { 200 line[strlen(line)-1] = '\0';
199 strcpy(line,appender(line, (char) c)); 201 } else if (isalnum(c) || ispunct(c) || c == ' ') {
202 strcpy(line,appender(line, (char) c));
203 }
204 } else {
205 break;
200 } 206 }
201 } 207 }
202 doMessenger(); 208 doMessenger();