summaryrefslogtreecommitdiff
path: root/testing/DHT_sendfiletest.c
diff options
context:
space:
mode:
Diffstat (limited to 'testing/DHT_sendfiletest.c')
-rw-r--r--testing/DHT_sendfiletest.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/testing/DHT_sendfiletest.c b/testing/DHT_sendfiletest.c
index fd4fd29f..9a455056 100644
--- a/testing/DHT_sendfiletest.c
+++ b/testing/DHT_sendfiletest.c
@@ -48,7 +48,7 @@ int main(int argc, char *argv[])
48 printf("usage %s ip port client_id(of friend to find ip_port of) filename(of file to send) client_id(ours)\n", argv[0]); 48 printf("usage %s ip port client_id(of friend to find ip_port of) filename(of file to send) client_id(ours)\n", argv[0]);
49 exit(0); 49 exit(0);
50 } 50 }
51 addfriend(argv[3]); 51 DHT_addfriend((uint8_t *)argv[3]);
52 IP_Port friend_ip; 52 IP_Port friend_ip;
53 int connection = -1; 53 int connection = -1;
54 int inconnection = -1; 54 int inconnection = -1;
@@ -66,15 +66,15 @@ int main(int argc, char *argv[])
66 IP_Port bootstrap_ip_port; 66 IP_Port bootstrap_ip_port;
67 bootstrap_ip_port.port = htons(atoi(argv[2])); 67 bootstrap_ip_port.port = htons(atoi(argv[2]));
68 bootstrap_ip_port.ip.i = inet_addr(argv[1]); 68 bootstrap_ip_port.ip.i = inet_addr(argv[1]);
69 bootstrap(bootstrap_ip_port); 69 DHT_bootstrap(bootstrap_ip_port);
70 70
71 IP_Port ip_port; 71 IP_Port ip_port;
72 char data[MAX_UDP_PACKET_SIZE]; 72 uint8_t data[MAX_UDP_PACKET_SIZE];
73 uint32_t length; 73 uint32_t length;
74 74
75 char buffer1[128]; 75 uint8_t buffer1[128];
76 int read1 = 0; 76 int read1 = 0;
77 char buffer2[128]; 77 uint8_t buffer2[128];
78 int read2 = 0; 78 int read2 = 0;
79 FILE *file1 = fopen(argv[4], "rb"); 79 FILE *file1 = fopen(argv[4], "rb");
80 if ( file1==NULL ){printf("Error opening file.\n");return 1;} 80 if ( file1==NULL ){printf("Error opening file.\n");return 1;}
@@ -100,7 +100,7 @@ int main(int argc, char *argv[])
100 } 100 }
101 } 101 }
102 } 102 }
103 friend_ip = getfriendip(argv[3]); 103 friend_ip = DHT_getfriendip((uint8_t *)argv[3]);
104 if(friend_ip.ip.i != 0) 104 if(friend_ip.ip.i != 0)
105 { 105 {
106 if(connection == -1) 106 if(connection == -1)