diff options
author | iphydf <iphydf@users.noreply.github.com> | 2016-09-12 16:48:35 +0100 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2016-09-16 12:06:02 +0100 |
commit | 1494e474dde58ec6e446cdbfad9a8d89f6c4796c (patch) | |
tree | e454a18a0f61468d10833d8e80039d025f94f568 | |
parent | 37c041f8159f7e89f2585243e9b8073f47d77fd1 (diff) |
Ensure that all TODOs have an owner.
In the future, all TODOs added either need a bug number (TODO(#NN)) or a
person's github user name. By default, I made irungentoo the owner of
all toxcore TODOs, mannol the owner of toxav TODOs, and myself the owner
of API TODOs.
-rw-r--r-- | auto_tests/assoc_test.c | 4 | ||||
-rw-r--r-- | auto_tests/messenger_test.c | 39 | ||||
-rw-r--r-- | auto_tests/toxav_basic_test.c | 2 | ||||
-rw-r--r-- | docs/Group-Chats.md | 2 | ||||
-rw-r--r-- | other/apidsl/tox.in.h | 4 | ||||
-rw-r--r-- | other/apidsl/toxav.in.h | 2 | ||||
-rw-r--r-- | testing/DHT_test.c | 6 | ||||
-rw-r--r-- | testing/Messenger_test.c | 2 | ||||
-rw-r--r-- | toxav/audio.c | 2 | ||||
-rw-r--r-- | toxav/group.c | 4 | ||||
-rw-r--r-- | toxav/toxav.c | 2 | ||||
-rw-r--r-- | toxav/toxav.h | 2 | ||||
-rw-r--r-- | toxav/video.c | 8 | ||||
-rw-r--r-- | toxcore/DHT.c | 51 | ||||
-rw-r--r-- | toxcore/DHT.h | 2 | ||||
-rw-r--r-- | toxcore/LAN_discovery.c | 2 | ||||
-rw-r--r-- | toxcore/Messenger.c | 13 | ||||
-rw-r--r-- | toxcore/Messenger.h | 6 | ||||
-rw-r--r-- | toxcore/TCP_client.c | 2 | ||||
-rw-r--r-- | toxcore/TCP_connection.c | 10 | ||||
-rw-r--r-- | toxcore/TCP_connection.h | 4 | ||||
-rw-r--r-- | toxcore/TCP_server.c | 4 | ||||
-rw-r--r-- | toxcore/assoc.c | 2 | ||||
-rw-r--r-- | toxcore/crypto_core.c | 6 | ||||
-rw-r--r-- | toxcore/friend_requests.h | 2 | ||||
-rw-r--r-- | toxcore/group.c | 31 | ||||
-rw-r--r-- | toxcore/net_crypto.c | 24 | ||||
-rw-r--r-- | toxcore/network.c | 7 | ||||
-rw-r--r-- | toxcore/onion_client.c | 10 | ||||
-rw-r--r-- | toxcore/tox.c | 10 | ||||
-rw-r--r-- | toxcore/tox.h | 4 | ||||
-rw-r--r-- | toxdns/toxdns.c | 2 |
32 files changed, 144 insertions, 127 deletions
diff --git a/auto_tests/assoc_test.c b/auto_tests/assoc_test.c index 887ffc0b..4814601c 100644 --- a/auto_tests/assoc_test.c +++ b/auto_tests/assoc_test.c | |||
@@ -17,7 +17,7 @@ | |||
17 | 17 | ||
18 | START_TEST(test_basics) | 18 | START_TEST(test_basics) |
19 | { | 19 | { |
20 | /* TODO: real test */ | 20 | /* TODO(irungentoo): real test */ |
21 | uint8_t id[crypto_box_PUBLICKEYBYTES] = {1}; | 21 | uint8_t id[crypto_box_PUBLICKEYBYTES] = {1}; |
22 | Assoc *assoc = new_Assoc_default(NULL, id); | 22 | Assoc *assoc = new_Assoc_default(NULL, id); |
23 | ck_assert_msg(assoc != NULL, "failed to create default assoc"); | 23 | ck_assert_msg(assoc != NULL, "failed to create default assoc"); |
@@ -61,7 +61,7 @@ END_TEST | |||
61 | 61 | ||
62 | START_TEST(test_fillup) | 62 | START_TEST(test_fillup) |
63 | { | 63 | { |
64 | /* TODO: real test */ | 64 | /* TODO(irungentoo): real test */ |
65 | int i, j; | 65 | int i, j; |
66 | uint8_t id[crypto_box_PUBLICKEYBYTES]; | 66 | uint8_t id[crypto_box_PUBLICKEYBYTES]; |
67 | //uint32_t a = current_time(); | 67 | //uint32_t a = current_time(); |
diff --git a/auto_tests/messenger_test.c b/auto_tests/messenger_test.c index 8f904ed1..5d0be284 100644 --- a/auto_tests/messenger_test.c +++ b/auto_tests/messenger_test.c | |||
@@ -120,7 +120,8 @@ START_TEST(test_m_delfriend) | |||
120 | REALLY_BIG_NUMBER); | 120 | REALLY_BIG_NUMBER); |
121 | } | 121 | } |
122 | END_TEST | 122 | END_TEST |
123 | /* | 123 | |
124 | #if 0 | ||
124 | START_TEST(test_m_addfriend) | 125 | START_TEST(test_m_addfriend) |
125 | { | 126 | { |
126 | char *good_data = "test"; | 127 | char *good_data = "test"; |
@@ -129,30 +130,34 @@ START_TEST(test_m_addfriend) | |||
129 | int good_len = strlen(good_data); | 130 | int good_len = strlen(good_data); |
130 | int bad_len = strlen(bad_data); | 131 | int bad_len = strlen(bad_data); |
131 | int really_bad_len = (MAX_CRYPTO_PACKET_SIZE - crypto_box_PUBLICKEYBYTES | 132 | int really_bad_len = (MAX_CRYPTO_PACKET_SIZE - crypto_box_PUBLICKEYBYTES |
132 | - crypto_box_NONCEBYTES - crypto_box_BOXZEROBYTES | 133 | - crypto_box_NONCEBYTES - crypto_box_BOXZEROBYTES |
133 | + crypto_box_ZEROBYTES + 100); */ | 134 | + crypto_box_ZEROBYTES + 100); |
134 | /* TODO: Update this properly to latest master | 135 | |
135 | if(m_addfriend(m, (uint8_t *)friend_id, (uint8_t *)good_data, really_bad_len) != FAERR_TOOLONG) | 136 | /* TODO(irungentoo): Update this properly to latest master */ |
137 | if (m_addfriend(m, (uint8_t *)friend_id, (uint8_t *)good_data, really_bad_len) != FAERR_TOOLONG) { | ||
136 | ck_abort_msg("m_addfriend did NOT catch the following length: %d\n", really_bad_len); | 138 | ck_abort_msg("m_addfriend did NOT catch the following length: %d\n", really_bad_len); |
137 | */ | 139 | } |
138 | /* this will return an error if the original m_addfriend_norequest() failed */ | 140 | |
139 | /* if(m_addfriend(m, (uint8_t *)friend_id, (uint8_t *)good_data, good_len) != FAERR_ALREADYSENT) | 141 | /* this will return an error if the original m_addfriend_norequest() failed */ |
142 | if (m_addfriend(m, (uint8_t *)friend_id, (uint8_t *)good_data, good_len) != FAERR_ALREADYSENT) { | ||
140 | ck_abort_msg("m_addfriend did NOT catch adding a friend we already have.\n" | 143 | ck_abort_msg("m_addfriend did NOT catch adding a friend we already have.\n" |
141 | "(this can be caused by the error of m_addfriend_norequest in" | 144 | "(this can be caused by the error of m_addfriend_norequest in" |
142 | " the beginning of the suite)\n"); | 145 | " the beginning of the suite)\n"); |
146 | } | ||
143 | 147 | ||
144 | if(m_addfriend(m, (uint8_t *)good_id_b, (uint8_t *)bad_data, bad_len) != FAERR_NOMESSAGE) | 148 | if (m_addfriend(m, (uint8_t *)good_id_b, (uint8_t *)bad_data, bad_len) != FAERR_NOMESSAGE) { |
145 | ck_abort_msg("m_addfriend did NOT catch the following length: %d\n", bad_len); | 149 | ck_abort_msg("m_addfriend did NOT catch the following length: %d\n", bad_len); |
146 | */ | 150 | } |
147 | /* this should REALLY return an error */ | ||
148 | /* | ||
149 | * TODO: validate client_id in m_addfriend? | ||
150 | if(m_addfriend((uint8_t *)bad_id, (uint8_t *)good_data, good_len) >= 0) | ||
151 | ck_abort_msg("The following ID passed through " | ||
152 | "m_addfriend without an error:\n'%s'\n", bad_id_str); | ||
153 | 151 | ||
152 | /* this should REALLY return an error */ | ||
153 | /* TODO(irungentoo): validate client_id in m_addfriend? */ | ||
154 | if (m_addfriend((uint8_t *)bad_id, (uint8_t *)good_data, good_len) >= 0) { | ||
155 | ck_abort_msg("The following ID passed through " | ||
156 | "m_addfriend without an error:\n'%s'\n", bad_id_str); | ||
157 | } | ||
154 | } | 158 | } |
155 | END_TEST */ | 159 | END_TEST |
160 | #endif | ||
156 | 161 | ||
157 | START_TEST(test_setname) | 162 | START_TEST(test_setname) |
158 | { | 163 | { |
diff --git a/auto_tests/toxav_basic_test.c b/auto_tests/toxav_basic_test.c index 399eac68..da874849 100644 --- a/auto_tests/toxav_basic_test.c +++ b/auto_tests/toxav_basic_test.c | |||
@@ -251,7 +251,7 @@ START_TEST(test_AV_flows) | |||
251 | } \ | 251 | } \ |
252 | BobCC.incoming = false; \ | 252 | BobCC.incoming = false; \ |
253 | } else { \ | 253 | } else { \ |
254 | /* TODO rtp */ \ | 254 | /* TODO(mannol): rtp */ \ |
255 | \ | 255 | \ |
256 | if (time(NULL) - start_time >= 1) { \ | 256 | if (time(NULL) - start_time >= 1) { \ |
257 | \ | 257 | \ |
diff --git a/docs/Group-Chats.md b/docs/Group-Chats.md index e937d549..2935c7f5 100644 --- a/docs/Group-Chats.md +++ b/docs/Group-Chats.md | |||
@@ -10,7 +10,7 @@ the invite or responds with a response packet if he wants to join the chat. The | |||
10 | of groupchat (text only, A/V) the friend is being invited to. | 10 | of groupchat (text only, A/V) the friend is being invited to. |
11 | 11 | ||
12 | 12 | ||
13 | TODO: write more of this. | 13 | TODO(irungentoo): write more of this. |
14 | 14 | ||
15 | ## Protocol | 15 | ## Protocol |
16 | 16 | ||
diff --git a/other/apidsl/tox.in.h b/other/apidsl/tox.in.h index 7953d4f6..e062e41f 100644 --- a/other/apidsl/tox.in.h +++ b/other/apidsl/tox.in.h | |||
@@ -267,7 +267,7 @@ const MAX_FRIEND_REQUEST_LENGTH = 1016; | |||
267 | const MAX_MESSAGE_LENGTH = 1372; | 267 | const MAX_MESSAGE_LENGTH = 1372; |
268 | 268 | ||
269 | /** | 269 | /** |
270 | * Maximum size of custom packets. TODO: should be LENGTH? | 270 | * Maximum size of custom packets. TODO(iphydf): should be LENGTH? |
271 | */ | 271 | */ |
272 | const MAX_CUSTOM_PACKET_SIZE = 1373; | 272 | const MAX_CUSTOM_PACKET_SIZE = 1373; |
273 | 273 | ||
@@ -786,7 +786,7 @@ inline namespace self { | |||
786 | * amounts of time. Clients should therefore not immediately bootstrap on | 786 | * amounts of time. Clients should therefore not immediately bootstrap on |
787 | * receiving a disconnect. | 787 | * receiving a disconnect. |
788 | * | 788 | * |
789 | * TODO: how long should a client wait before bootstrapping again? | 789 | * TODO(iphydf): how long should a client wait before bootstrapping again? |
790 | */ | 790 | */ |
791 | event connection_status const { | 791 | event connection_status const { |
792 | /** | 792 | /** |
diff --git a/other/apidsl/toxav.in.h b/other/apidsl/toxav.in.h index 4bb7487d..8a7d5358 100644 --- a/other/apidsl/toxav.in.h +++ b/other/apidsl/toxav.in.h | |||
@@ -652,7 +652,7 @@ namespace video { | |||
652 | 652 | ||
653 | %{ | 653 | %{ |
654 | /** | 654 | /** |
655 | * NOTE Compatibility with old toxav group calls TODO remove | 655 | * NOTE Compatibility with old toxav group calls. TODO(iphydf): remove |
656 | */ | 656 | */ |
657 | /* Create a new toxav group. | 657 | /* Create a new toxav group. |
658 | * | 658 | * |
diff --git a/testing/DHT_test.c b/testing/DHT_test.c index 04340b0e..df4b0c83 100644 --- a/testing/DHT_test.c +++ b/testing/DHT_test.c | |||
@@ -153,7 +153,7 @@ static void print_friendlist(DHT *dht) | |||
153 | } | 153 | } |
154 | } | 154 | } |
155 | 155 | ||
156 | #if 0 /* slvrTODO: */ | 156 | #if 0 /* TODO(slvr): */ |
157 | static void printpacket(uint8_t *data, uint32_t length, IP_Port ip_port) | 157 | static void printpacket(uint8_t *data, uint32_t length, IP_Port ip_port) |
158 | { | 158 | { |
159 | uint32_t i; | 159 | uint32_t i; |
@@ -232,7 +232,7 @@ int main(int argc, char *argv[]) | |||
232 | return 1; | 232 | return 1; |
233 | } | 233 | } |
234 | 234 | ||
235 | #if 0 /* slvrTODO: */ | 235 | #if 0 /* TODO(slvr): */ |
236 | IP_Port ip_port; | 236 | IP_Port ip_port; |
237 | uint8_t data[MAX_UDP_PACKET_SIZE]; | 237 | uint8_t data[MAX_UDP_PACKET_SIZE]; |
238 | uint32_t length; | 238 | uint32_t length; |
@@ -241,7 +241,7 @@ int main(int argc, char *argv[]) | |||
241 | while (1) { | 241 | while (1) { |
242 | do_DHT(dht); | 242 | do_DHT(dht); |
243 | 243 | ||
244 | #if 0 /* slvrTODO: */ | 244 | #if 0 /* TODO(slvr): */ |
245 | 245 | ||
246 | while (receivepacket(&ip_port, data, &length) != -1) { | 246 | while (receivepacket(&ip_port, data, &length) != -1) { |
247 | if (DHT_handlepacket(data, length, ip_port) && friendreq_handlepacket(data, length, ip_port)) { | 247 | if (DHT_handlepacket(data, length, ip_port) && friendreq_handlepacket(data, length, ip_port)) { |
diff --git a/testing/Messenger_test.c b/testing/Messenger_test.c index c4a9e2f1..015ba8e5 100644 --- a/testing/Messenger_test.c +++ b/testing/Messenger_test.c | |||
@@ -63,7 +63,7 @@ static void print_message(Messenger *m, uint32_t friendnumber, unsigned int type | |||
63 | m_send_message_generic(m, friendnumber, type, (const uint8_t *)"Test1", 6, 0); | 63 | m_send_message_generic(m, friendnumber, type, (const uint8_t *)"Test1", 6, 0); |
64 | } | 64 | } |
65 | 65 | ||
66 | /* FIXME needed as print_request has to match the interface expected by | 66 | /* TODO(irungentoo): needed as print_request has to match the interface expected by |
67 | * networking_requesthandler and so cannot take a Messenger * */ | 67 | * networking_requesthandler and so cannot take a Messenger * */ |
68 | static Messenger *m; | 68 | static Messenger *m; |
69 | 69 | ||
diff --git a/toxav/audio.c b/toxav/audio.c index 0b3db00f..59d1554e 100644 --- a/toxav/audio.c +++ b/toxav/audio.c | |||
@@ -131,7 +131,7 @@ void ac_iterate(ACSession *ac) | |||
131 | return; | 131 | return; |
132 | } | 132 | } |
133 | 133 | ||
134 | /* TODO fix this and jitter buffering */ | 134 | /* TODO(mannol): fix this and jitter buffering */ |
135 | 135 | ||
136 | /* Enough space for the maximum frame size (120 ms 48 KHz stereo audio) */ | 136 | /* Enough space for the maximum frame size (120 ms 48 KHz stereo audio) */ |
137 | int16_t tmp[5760 * 2]; | 137 | int16_t tmp[5760 * 2]; |
diff --git a/toxav/group.c b/toxav/group.c index ea84bf72..66c73572 100644 --- a/toxav/group.c +++ b/toxav/group.c | |||
@@ -552,9 +552,9 @@ int group_send_audio(Group_Chats *g_c, int groupnumber, const int16_t *pcm, unsi | |||
552 | group_av->audio_sample_rate = sample_rate; | 552 | group_av->audio_sample_rate = sample_rate; |
553 | 553 | ||
554 | if (channels == 1) { | 554 | if (channels == 1) { |
555 | group_av->audio_bitrate = 32000; //TODO: add way of adjusting bitrate | 555 | group_av->audio_bitrate = 32000; // TODO(mannol): add way of adjusting bitrate |
556 | } else { | 556 | } else { |
557 | group_av->audio_bitrate = 64000; //TODO: add way of adjusting bitrate | 557 | group_av->audio_bitrate = 64000; // TODO(mannol): add way of adjusting bitrate |
558 | } | 558 | } |
559 | 559 | ||
560 | if (recreate_encoder(group_av) == -1) { | 560 | if (recreate_encoder(group_av) == -1) { |
diff --git a/toxav/toxav.c b/toxav/toxav.c index 81476d32..1ae914e8 100644 --- a/toxav/toxav.c +++ b/toxav/toxav.c | |||
@@ -1033,7 +1033,7 @@ bool audio_bit_rate_invalid(uint32_t bit_rate) | |||
1033 | bool video_bit_rate_invalid(uint32_t bit_rate) | 1033 | bool video_bit_rate_invalid(uint32_t bit_rate) |
1034 | { | 1034 | { |
1035 | (void) bit_rate; | 1035 | (void) bit_rate; |
1036 | /* TODO: If anyone knows the answer to this one please fill it up */ | 1036 | /* TODO(mannol): If anyone knows the answer to this one please fill it up */ |
1037 | return false; | 1037 | return false; |
1038 | } | 1038 | } |
1039 | bool invoke_call_state_callback(ToxAV *av, uint32_t friend_number, uint32_t state) | 1039 | bool invoke_call_state_callback(ToxAV *av, uint32_t friend_number, uint32_t state) |
diff --git a/toxav/toxav.h b/toxav/toxav.h index ea7ee194..38ba354e 100644 --- a/toxav/toxav.h +++ b/toxav/toxav.h | |||
@@ -777,7 +777,7 @@ typedef void toxav_video_receive_frame_cb(ToxAV *av, uint32_t friend_number, uin | |||
777 | void toxav_callback_video_receive_frame(ToxAV *av, toxav_video_receive_frame_cb *callback, void *user_data); | 777 | void toxav_callback_video_receive_frame(ToxAV *av, toxav_video_receive_frame_cb *callback, void *user_data); |
778 | 778 | ||
779 | /** | 779 | /** |
780 | * NOTE Compatibility with old toxav group calls TODO remove | 780 | * NOTE Compatibility with old toxav group calls. TODO(iphydf): remove |
781 | */ | 781 | */ |
782 | /* Create a new toxav group. | 782 | /* Create a new toxav group. |
783 | * | 783 | * |
diff --git a/toxav/video.c b/toxav/video.c index 9aba27ed..de028c7c 100644 --- a/toxav/video.c +++ b/toxav/video.c | |||
@@ -77,9 +77,11 @@ VCSession *vc_new(Logger *log, ToxAV *av, uint32_t friend_number, toxav_video_re | |||
77 | cfg.g_w = 800; | 77 | cfg.g_w = 800; |
78 | cfg.g_h = 600; | 78 | cfg.g_h = 600; |
79 | cfg.g_pass = VPX_RC_ONE_PASS; | 79 | cfg.g_pass = VPX_RC_ONE_PASS; |
80 | /* FIXME If we set error resilience the app will crash due to bug in vp8. | 80 | /* TODO(mannol): If we set error resilience the app will crash due to bug in vp8. |
81 | Perhaps vp9 has solved it?*/ | 81 | Perhaps vp9 has solved it?*/ |
82 | // cfg.g_error_resilient = VPX_ERROR_RESILIENT_DEFAULT | VPX_ERROR_RESILIENT_PARTITIONS; | 82 | #if 0 |
83 | cfg.g_error_resilient = VPX_ERROR_RESILIENT_DEFAULT | VPX_ERROR_RESILIENT_PARTITIONS; | ||
84 | #endif | ||
83 | cfg.g_lag_in_frames = 0; | 85 | cfg.g_lag_in_frames = 0; |
84 | cfg.kf_min_dist = 0; | 86 | cfg.kf_min_dist = 0; |
85 | cfg.kf_max_dist = 48; | 87 | cfg.kf_max_dist = 48; |
diff --git a/toxcore/DHT.c b/toxcore/DHT.c index e7fd0a9d..2f078314 100644 --- a/toxcore/DHT.c +++ b/toxcore/DHT.c | |||
@@ -243,7 +243,7 @@ static int pack_ip_port(uint8_t *data, uint16_t length, const IP_Port *ip_port) | |||
243 | uint8_t net_family; | 243 | uint8_t net_family; |
244 | 244 | ||
245 | if (ip_port->ip.family == AF_INET) { | 245 | if (ip_port->ip.family == AF_INET) { |
246 | // FIXME use functions to convert endianness | 246 | // TODO(irungentoo): use functions to convert endianness |
247 | ipv6 = 0; | 247 | ipv6 = 0; |
248 | net_family = TOX_AF_INET; | 248 | net_family = TOX_AF_INET; |
249 | } else if (ip_port->ip.family == TCP_INET) { | 249 | } else if (ip_port->ip.family == TCP_INET) { |
@@ -432,7 +432,7 @@ int unpack_nodes(Node_format *nodes, uint16_t max_num_nodes, uint16_t *processed | |||
432 | /* Check if client with public_key is already in list of length length. | 432 | /* Check if client with public_key is already in list of length length. |
433 | * If it is then set its corresponding timestamp to current time. | 433 | * If it is then set its corresponding timestamp to current time. |
434 | * If the id is already in the list with a different ip_port, update it. | 434 | * If the id is already in the list with a different ip_port, update it. |
435 | * TODO: Maybe optimize this. | 435 | * TODO(irungentoo): Maybe optimize this. |
436 | * | 436 | * |
437 | * return True(1) or False(0) | 437 | * return True(1) or False(0) |
438 | */ | 438 | */ |
@@ -482,7 +482,7 @@ static int client_or_ip_port_in_list(Logger *log, Client_data *list, uint16_t le | |||
482 | 482 | ||
483 | /* public_key not in list yet: see if we can find an identical ip_port, in | 483 | /* public_key not in list yet: see if we can find an identical ip_port, in |
484 | * that case we kill the old public_key by overwriting it with the new one | 484 | * that case we kill the old public_key by overwriting it with the new one |
485 | * TODO: maybe we SHOULDN'T do that if that public_key is in a friend_list | 485 | * TODO(irungentoo): maybe we SHOULDN'T do that if that public_key is in a friend_list |
486 | * and the one who is the actual friend's public_key/address set? */ | 486 | * and the one who is the actual friend's public_key/address set? */ |
487 | for (i = 0; i < length; ++i) { | 487 | for (i = 0; i < length; ++i) { |
488 | /* MAYBE: check the other address, if valid, don't nuke? */ | 488 | /* MAYBE: check the other address, if valid, don't nuke? */ |
@@ -576,7 +576,7 @@ bool add_to_list(Node_format *nodes_list, unsigned int length, const uint8_t *pk | |||
576 | return 0; | 576 | return 0; |
577 | } | 577 | } |
578 | 578 | ||
579 | /*TODO: change this to 7 when done*/ | 579 | /* TODO(irungentoo): change this to 7 when done*/ |
580 | #define HARDENING_ALL_OK 2 | 580 | #define HARDENING_ALL_OK 2 |
581 | /* return 0 if not. | 581 | /* return 0 if not. |
582 | * return 1 if route request are ok | 582 | * return 1 if route request are ok |
@@ -657,8 +657,8 @@ static void get_close_nodes_inner(const uint8_t *public_key, Node_format *nodes_ | |||
657 | /* Find MAX_SENT_NODES nodes closest to the public_key for the send nodes request: | 657 | /* Find MAX_SENT_NODES nodes closest to the public_key for the send nodes request: |
658 | * put them in the nodes_list and return how many were found. | 658 | * put them in the nodes_list and return how many were found. |
659 | * | 659 | * |
660 | * TODO: For the love of based <your favorite deity, in doubt use "love"> make | 660 | * TODO(irungentoo): For the love of based <your favorite deity, in doubt use |
661 | * this function cleaner and much more efficient. | 661 | * "love"> make this function cleaner and much more efficient. |
662 | * | 662 | * |
663 | * want_good : do we want only good nodes as checked with the hardening returned or not? | 663 | * want_good : do we want only good nodes as checked with the hardening returned or not? |
664 | */ | 664 | */ |
@@ -669,12 +669,17 @@ static int get_somewhat_close_nodes(const DHT *dht, const uint8_t *public_key, N | |||
669 | get_close_nodes_inner(public_key, nodes_list, sa_family, | 669 | get_close_nodes_inner(public_key, nodes_list, sa_family, |
670 | dht->close_clientlist, LCLIENT_LIST, &num_nodes, is_LAN, 0); | 670 | dht->close_clientlist, LCLIENT_LIST, &num_nodes, is_LAN, 0); |
671 | 671 | ||
672 | /*TODO uncomment this when hardening is added to close friend clients | 672 | /* TODO(irungentoo): uncomment this when hardening is added to close friend clients */ |
673 | for (i = 0; i < dht->num_friends; ++i) | 673 | #if 0 |
674 | get_close_nodes_inner(dht, public_key, nodes_list, sa_family, | 674 | |
675 | dht->friends_list[i].client_list, MAX_FRIEND_CLIENTS, | 675 | for (i = 0; i < dht->num_friends; ++i) { |
676 | &num_nodes, is_LAN, want_good); | 676 | get_close_nodes_inner(dht, public_key, nodes_list, sa_family, |
677 | */ | 677 | dht->friends_list[i].client_list, MAX_FRIEND_CLIENTS, |
678 | &num_nodes, is_LAN, want_good); | ||
679 | } | ||
680 | |||
681 | #endif | ||
682 | |||
678 | for (i = 0; i < dht->num_friends; ++i) { | 683 | for (i = 0; i < dht->num_friends; ++i) { |
679 | get_close_nodes_inner(public_key, nodes_list, sa_family, | 684 | get_close_nodes_inner(public_key, nodes_list, sa_family, |
680 | dht->friends_list[i].client_list, MAX_FRIEND_CLIENTS, | 685 | dht->friends_list[i].client_list, MAX_FRIEND_CLIENTS, |
@@ -695,7 +700,7 @@ int get_close_nodes(const DHT *dht, const uint8_t *public_key, Node_format *node | |||
695 | return get_somewhat_close_nodes(dht, public_key, nodes_list, sa_family, is_LAN, want_good); | 700 | return get_somewhat_close_nodes(dht, public_key, nodes_list, sa_family, is_LAN, want_good); |
696 | 701 | ||
697 | #ifdef ENABLE_ASSOC_DHT | 702 | #ifdef ENABLE_ASSOC_DHT |
698 | //TODO: assoc, sa_family 0 (don't care if ipv4 or ipv6) support. | 703 | // TODO(irungentoo): assoc, sa_family 0 (don't care if ipv4 or ipv6) support. |
699 | Client_data *result[MAX_SENT_NODES]; | 704 | Client_data *result[MAX_SENT_NODES]; |
700 | 705 | ||
701 | Assoc_close_entries request; | 706 | Assoc_close_entries request; |
@@ -970,7 +975,7 @@ static unsigned int ping_node_from_getnodes_ok(DHT *dht, const uint8_t *public_k | |||
970 | dht->to_bootstrap[dht->num_to_bootstrap].ip_port = ip_port; | 975 | dht->to_bootstrap[dht->num_to_bootstrap].ip_port = ip_port; |
971 | ++dht->num_to_bootstrap; | 976 | ++dht->num_to_bootstrap; |
972 | } else { | 977 | } else { |
973 | //TODO: ipv6 vs v4 | 978 | // TODO(irungentoo): ipv6 vs v4 |
974 | add_to_list(dht->to_bootstrap, MAX_CLOSE_TO_BOOTSTRAP_NODES, public_key, ip_port, dht->self_public_key); | 979 | add_to_list(dht->to_bootstrap, MAX_CLOSE_TO_BOOTSTRAP_NODES, public_key, ip_port, dht->self_public_key); |
975 | } | 980 | } |
976 | } | 981 | } |
@@ -1536,7 +1541,7 @@ int DHT_delfriend(DHT *dht, const uint8_t *public_key, uint16_t lock_count) | |||
1536 | return 0; | 1541 | return 0; |
1537 | } | 1542 | } |
1538 | 1543 | ||
1539 | /* TODO: Optimize this. */ | 1544 | /* TODO(irungentoo): Optimize this. */ |
1540 | int DHT_getfriendip(const DHT *dht, const uint8_t *public_key, IP_Port *ip_port) | 1545 | int DHT_getfriendip(const DHT *dht, const uint8_t *public_key, IP_Port *ip_port) |
1541 | { | 1546 | { |
1542 | uint32_t i, j; | 1547 | uint32_t i, j; |
@@ -2113,7 +2118,7 @@ static void punch_holes(DHT *dht, IP ip, uint16_t *port_list, uint16_t numports, | |||
2113 | send_ping_request(dht->ping, pinging, dht->friends_list[friend_num].public_key); | 2118 | send_ping_request(dht->ping, pinging, dht->friends_list[friend_num].public_key); |
2114 | } else { | 2119 | } else { |
2115 | for (i = dht->friends_list[friend_num].nat.punching_index; i != top; ++i) { | 2120 | for (i = dht->friends_list[friend_num].nat.punching_index; i != top; ++i) { |
2116 | /* TODO: Improve port guessing algorithm. */ | 2121 | /* TODO(irungentoo): Improve port guessing algorithm. */ |
2117 | uint16_t port = port_list[(i / 2) % numports] + (i / (2 * numports)) * ((i % 2) ? -1 : 1); | 2122 | uint16_t port = port_list[(i / 2) % numports] + (i / (2 * numports)) * ((i % 2) ? -1 : 1); |
2118 | IP_Port pinging; | 2123 | IP_Port pinging; |
2119 | ip_copy(&pinging.ip, &ip); | 2124 | ip_copy(&pinging.ip, &ip); |
@@ -2246,7 +2251,7 @@ static int send_hardening_getnode_res(const DHT *dht, const Node_format *sendto, | |||
2246 | return sendpacket(dht->net, sendto->ip_port, packet, len); | 2251 | return sendpacket(dht->net, sendto->ip_port, packet, len); |
2247 | } | 2252 | } |
2248 | 2253 | ||
2249 | /* TODO: improve */ | 2254 | /* TODO(irungentoo): improve */ |
2250 | static IPPTsPng *get_closelist_IPPTsPng(DHT *dht, const uint8_t *public_key, sa_family_t sa_family) | 2255 | static IPPTsPng *get_closelist_IPPTsPng(DHT *dht, const uint8_t *public_key, sa_family_t sa_family) |
2251 | { | 2256 | { |
2252 | uint32_t i; | 2257 | uint32_t i; |
@@ -2270,7 +2275,7 @@ static IPPTsPng *get_closelist_IPPTsPng(DHT *dht, const uint8_t *public_key, sa_ | |||
2270 | 2275 | ||
2271 | /* | 2276 | /* |
2272 | * check how many nodes in nodes are also present in the closelist. | 2277 | * check how many nodes in nodes are also present in the closelist. |
2273 | * TODO: make this function better. | 2278 | * TODO(irungentoo): make this function better. |
2274 | */ | 2279 | */ |
2275 | static uint32_t have_nodes_closelist(DHT *dht, Node_format *nodes, uint16_t num) | 2280 | static uint32_t have_nodes_closelist(DHT *dht, Node_format *nodes, uint16_t num) |
2276 | { | 2281 | { |
@@ -2340,7 +2345,7 @@ static int handle_hardening(void *object, IP_Port source, const uint8_t *source_ | |||
2340 | Node_format nodes[MAX_SENT_NODES]; | 2345 | Node_format nodes[MAX_SENT_NODES]; |
2341 | int num_nodes = unpack_nodes(nodes, MAX_SENT_NODES, 0, packet + 1 + crypto_box_PUBLICKEYBYTES, length_nodes, 0); | 2346 | int num_nodes = unpack_nodes(nodes, MAX_SENT_NODES, 0, packet + 1 + crypto_box_PUBLICKEYBYTES, length_nodes, 0); |
2342 | 2347 | ||
2343 | /* TODO: MAX_SENT_NODES nodes should be returned at all times | 2348 | /* TODO(irungentoo): MAX_SENT_NODES nodes should be returned at all times |
2344 | (right now we have a small network size so it could cause problems for testing and etc..) */ | 2349 | (right now we have a small network size so it could cause problems for testing and etc..) */ |
2345 | if (num_nodes <= 0) { | 2350 | if (num_nodes <= 0) { |
2346 | return 1; | 2351 | return 1; |
@@ -2376,7 +2381,7 @@ static int handle_hardening(void *object, IP_Port source, const uint8_t *source_ | |||
2376 | 2381 | ||
2377 | #if DHT_HARDENING | 2382 | #if DHT_HARDENING |
2378 | /* Return a random node from all the nodes we are connected to. | 2383 | /* Return a random node from all the nodes we are connected to. |
2379 | * TODO: improve this function. | 2384 | * TODO(irungentoo): improve this function. |
2380 | */ | 2385 | */ |
2381 | static Node_format random_node(DHT *dht, sa_family_t sa_family) | 2386 | static Node_format random_node(DHT *dht, sa_family_t sa_family) |
2382 | { | 2387 | { |
@@ -2515,7 +2520,7 @@ static void do_hardening(DHT *dht) | |||
2515 | to_test.ip_port = cur_iptspng->ip_port; | 2520 | to_test.ip_port = cur_iptspng->ip_port; |
2516 | memcpy(to_test.public_key, public_key, crypto_box_PUBLICKEYBYTES); | 2521 | memcpy(to_test.public_key, public_key, crypto_box_PUBLICKEYBYTES); |
2517 | 2522 | ||
2518 | //TODO: The search id should maybe not be ours? | 2523 | // TODO(irungentoo): The search id should maybe not be ours? |
2519 | if (send_hardening_getnode_req(dht, &rand_node, &to_test, dht->self_public_key) > 0) { | 2524 | if (send_hardening_getnode_req(dht, &rand_node, &to_test, dht->self_public_key) > 0) { |
2520 | memcpy(cur_iptspng->hardening.send_nodes_pingedid, rand_node.public_key, crypto_box_PUBLICKEYBYTES); | 2525 | memcpy(cur_iptspng->hardening.send_nodes_pingedid, rand_node.public_key, crypto_box_PUBLICKEYBYTES); |
2521 | cur_iptspng->hardening.send_nodes_timestamp = unix_time(); | 2526 | cur_iptspng->hardening.send_nodes_timestamp = unix_time(); |
@@ -2527,7 +2532,7 @@ static void do_hardening(DHT *dht) | |||
2527 | } | 2532 | } |
2528 | } | 2533 | } |
2529 | 2534 | ||
2530 | //TODO: add the 2 other testers. | 2535 | // TODO(irungentoo): add the 2 other testers. |
2531 | } | 2536 | } |
2532 | } | 2537 | } |
2533 | #endif | 2538 | #endif |
@@ -2681,7 +2686,7 @@ void kill_DHT(DHT *dht) | |||
2681 | } | 2686 | } |
2682 | 2687 | ||
2683 | /* new DHT format for load/save, more robust and forward compatible */ | 2688 | /* new DHT format for load/save, more robust and forward compatible */ |
2684 | //TODO: Move this closer to Messenger. | 2689 | // TODO(irungentoo): Move this closer to Messenger. |
2685 | #define DHT_STATE_COOKIE_GLOBAL 0x159000d | 2690 | #define DHT_STATE_COOKIE_GLOBAL 0x159000d |
2686 | 2691 | ||
2687 | #define DHT_STATE_COOKIE_TYPE 0x11ce | 2692 | #define DHT_STATE_COOKIE_TYPE 0x11ce |
diff --git a/toxcore/DHT.h b/toxcore/DHT.h index c5cde320..28848a4d 100644 --- a/toxcore/DHT.h +++ b/toxcore/DHT.h | |||
@@ -325,7 +325,7 @@ bool node_addable_to_close_list(DHT *dht, const uint8_t *public_key, IP_Port ip_ | |||
325 | * | 325 | * |
326 | * sa_family = family (IPv4 or IPv6) (0 if we don't care)? | 326 | * sa_family = family (IPv4 or IPv6) (0 if we don't care)? |
327 | * is_LAN = return some LAN ips (true or false) | 327 | * is_LAN = return some LAN ips (true or false) |
328 | * want_good = do we want tested nodes or not? (TODO) | 328 | * want_good = do we want tested nodes or not? (TODO(irungentoo)) |
329 | * | 329 | * |
330 | * return the number of nodes returned. | 330 | * return the number of nodes returned. |
331 | * | 331 | * |
diff --git a/toxcore/LAN_discovery.c b/toxcore/LAN_discovery.c index 22ea466a..1c28756b 100644 --- a/toxcore/LAN_discovery.c +++ b/toxcore/LAN_discovery.c | |||
@@ -168,7 +168,7 @@ static void fetch_broadcast_info(uint16_t port) | |||
168 | close(sock); | 168 | close(sock); |
169 | } | 169 | } |
170 | 170 | ||
171 | #else //TODO: Other platforms? | 171 | #else // TODO(irungentoo): Other platforms? |
172 | 172 | ||
173 | static void fetch_broadcast_info(uint16_t port) | 173 | static void fetch_broadcast_info(uint16_t port) |
174 | { | 174 | { |
diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index 3488fcca..def05449 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c | |||
@@ -1449,7 +1449,8 @@ int file_data(const Messenger *m, int32_t friendnumber, uint32_t filenumber, uin | |||
1449 | return -7; | 1449 | return -7; |
1450 | } | 1450 | } |
1451 | 1451 | ||
1452 | /* Prevent file sending from filling up the entire buffer preventing messages from being sent. TODO: remove */ | 1452 | /* Prevent file sending from filling up the entire buffer preventing messages from being sent. |
1453 | * TODO(irungentoo): remove */ | ||
1453 | if (crypto_num_free_sendqueue_slots(m->net_crypto, friend_connection_crypt_connection_id(m->fr_c, | 1454 | if (crypto_num_free_sendqueue_slots(m->net_crypto, friend_connection_crypt_connection_id(m->fr_c, |
1454 | m->friendlist[friendnumber].friendcon_id)) < MIN_SLOTS_FREE) { | 1455 | m->friendlist[friendnumber].friendcon_id)) < MIN_SLOTS_FREE) { |
1455 | return -6; | 1456 | return -6; |
@@ -1458,7 +1459,7 @@ int file_data(const Messenger *m, int32_t friendnumber, uint32_t filenumber, uin | |||
1458 | int64_t ret = send_file_data_packet(m, friendnumber, filenumber, data, length); | 1459 | int64_t ret = send_file_data_packet(m, friendnumber, filenumber, data, length); |
1459 | 1460 | ||
1460 | if (ret != -1) { | 1461 | if (ret != -1) { |
1461 | //TODO record packet ids to check if other received complete file. | 1462 | // TODO(irungentoo): record packet ids to check if other received complete file. |
1462 | ft->transferred += length; | 1463 | ft->transferred += length; |
1463 | 1464 | ||
1464 | if (ft->slots_allocated) { | 1465 | if (ft->slots_allocated) { |
@@ -1541,7 +1542,7 @@ static void do_reqchunk_filecb(Messenger *m, int32_t friendnumber, void *userdat | |||
1541 | } | 1542 | } |
1542 | } | 1543 | } |
1543 | 1544 | ||
1544 | /* TODO: if file is too slow, switch to the next. */ | 1545 | /* TODO(irungentoo): if file is too slow, switch to the next. */ |
1545 | if (ft->slots_allocated > (unsigned int)free_slots) { | 1546 | if (ft->slots_allocated > (unsigned int)free_slots) { |
1546 | free_slots = 0; | 1547 | free_slots = 0; |
1547 | } else { | 1548 | } else { |
@@ -1600,7 +1601,7 @@ static void break_files(const Messenger *m, int32_t friendnumber) | |||
1600 | { | 1601 | { |
1601 | uint32_t i; | 1602 | uint32_t i; |
1602 | 1603 | ||
1603 | //TODO: Inform the client which file transfers get killed with a callback? | 1604 | // TODO(irungentoo): Inform the client which file transfers get killed with a callback? |
1604 | for (i = 0; i < MAX_CONCURRENT_FILE_PIPES; ++i) { | 1605 | for (i = 0; i < MAX_CONCURRENT_FILE_PIPES; ++i) { |
1605 | if (m->friendlist[friendnumber].file_sending[i].status != FILESTATUS_NONE) { | 1606 | if (m->friendlist[friendnumber].file_sending[i].status != FILESTATUS_NONE) { |
1606 | m->friendlist[friendnumber].file_sending[i].status = FILESTATUS_NONE; | 1607 | m->friendlist[friendnumber].file_sending[i].status = FILESTATUS_NONE; |
@@ -2438,7 +2439,7 @@ static char *ID2String(const uint8_t *pk) | |||
2438 | } | 2439 | } |
2439 | 2440 | ||
2440 | /* Minimum messenger run interval in ms | 2441 | /* Minimum messenger run interval in ms |
2441 | TODO: A/V */ | 2442 | TODO(mannol): A/V */ |
2442 | #define MIN_RUN_INTERVAL 50 | 2443 | #define MIN_RUN_INTERVAL 50 |
2443 | 2444 | ||
2444 | /* Return the time in milliseconds before do_messenger() should be called again | 2445 | /* Return the time in milliseconds before do_messenger() should be called again |
@@ -2710,7 +2711,7 @@ static int friends_list_load(Messenger *m, const uint8_t *data, uint32_t length) | |||
2710 | net_to_host(last_seen_time, sizeof(uint64_t)); | 2711 | net_to_host(last_seen_time, sizeof(uint64_t)); |
2711 | memcpy(&m->friendlist[fnum].last_seen_time, last_seen_time, sizeof(uint64_t)); | 2712 | memcpy(&m->friendlist[fnum].last_seen_time, last_seen_time, sizeof(uint64_t)); |
2712 | } else if (temp.status != 0) { | 2713 | } else if (temp.status != 0) { |
2713 | /* TODO: This is not a good way to do this. */ | 2714 | /* TODO(irungentoo): This is not a good way to do this. */ |
2714 | uint8_t address[FRIEND_ADDRESS_SIZE]; | 2715 | uint8_t address[FRIEND_ADDRESS_SIZE]; |
2715 | id_copy(address, temp.real_pk); | 2716 | id_copy(address, temp.real_pk); |
2716 | memcpy(address + crypto_box_PUBLICKEYBYTES, &(temp.friendrequest_nospam), sizeof(uint32_t)); | 2717 | memcpy(address + crypto_box_PUBLICKEYBYTES, &(temp.friendrequest_nospam), sizeof(uint32_t)); |
diff --git a/toxcore/Messenger.h b/toxcore/Messenger.h index 59cb401e..2317eb8b 100644 --- a/toxcore/Messenger.h +++ b/toxcore/Messenger.h | |||
@@ -31,7 +31,7 @@ | |||
31 | #include "logger.h" | 31 | #include "logger.h" |
32 | 32 | ||
33 | #define MAX_NAME_LENGTH 128 | 33 | #define MAX_NAME_LENGTH 128 |
34 | /* TODO: this must depend on other variable. */ | 34 | /* TODO(irungentoo): this must depend on other variable. */ |
35 | #define MAX_STATUSMESSAGE_LENGTH 1007 | 35 | #define MAX_STATUSMESSAGE_LENGTH 1007 |
36 | /* Used for TCP relays in Messenger struct (may need to be % 2 == 0)*/ | 36 | /* Used for TCP relays in Messenger struct (may need to be % 2 == 0)*/ |
37 | #define NUM_SAVED_TCP_RELAYS 8 | 37 | #define NUM_SAVED_TCP_RELAYS 8 |
@@ -278,7 +278,9 @@ void getaddress(const Messenger *m, uint8_t *address); | |||
278 | 278 | ||
279 | /* Add a friend. | 279 | /* Add a friend. |
280 | * Set the data that will be sent along with friend request. | 280 | * Set the data that will be sent along with friend request. |
281 | * address is the address of the friend (returned by getaddress of the friend you wish to add) it must be FRIEND_ADDRESS_SIZE bytes. TODO: add checksum. | 281 | * address is the address of the friend (returned by getaddress of the friend |
282 | * you wish to add) it must be FRIEND_ADDRESS_SIZE bytes. | ||
283 | * TODO(irungentoo): add checksum. | ||
282 | * data is the data and length is the length. | 284 | * data is the data and length is the length. |
283 | * | 285 | * |
284 | * return the friend number if success. | 286 | * return the friend number if success. |
diff --git a/toxcore/TCP_client.c b/toxcore/TCP_client.c index 6c5ea0e1..396bb9e3 100644 --- a/toxcore/TCP_client.c +++ b/toxcore/TCP_client.c | |||
@@ -152,7 +152,7 @@ static int socks5_read_handshake_response(TCP_Client_Connection *TCP_conn) | |||
152 | return 0; | 152 | return 0; |
153 | } | 153 | } |
154 | 154 | ||
155 | if (data[0] == 5 && data[1] == 0) { // FIXME magic numbers | 155 | if (data[0] == 5 && data[1] == 0) { // TODO(irungentoo): magic numbers |
156 | return 1; | 156 | return 1; |
157 | } | 157 | } |
158 | 158 | ||
diff --git a/toxcore/TCP_connection.c b/toxcore/TCP_connection.c index bfd55fa0..25dfa09c 100644 --- a/toxcore/TCP_connection.c +++ b/toxcore/TCP_connection.c | |||
@@ -223,8 +223,8 @@ int send_packet_tcp_connection(TCP_Connections *tcp_c, int connections_number, c | |||
223 | return -1; | 223 | return -1; |
224 | } | 224 | } |
225 | 225 | ||
226 | //TODO: detect and kill bad relays. | 226 | // TODO(irungentoo): detect and kill bad relays. |
227 | //TODO: thread safety? | 227 | // TODO(irungentoo): thread safety? |
228 | unsigned int i; | 228 | unsigned int i; |
229 | int ret = -1; | 229 | int ret = -1; |
230 | 230 | ||
@@ -293,8 +293,8 @@ int send_packet_tcp_connection(TCP_Connections *tcp_c, int connections_number, c | |||
293 | 293 | ||
294 | /* Return a random TCP connection number for use in send_tcp_onion_request. | 294 | /* Return a random TCP connection number for use in send_tcp_onion_request. |
295 | * | 295 | * |
296 | * TODO: This number is just the index of an array that the elements can | 296 | * TODO(irungentoo): This number is just the index of an array that the elements |
297 | * change without warning. | 297 | * can change without warning. |
298 | * | 298 | * |
299 | * return TCP connection number on success. | 299 | * return TCP connection number on success. |
300 | * return -1 on failure. | 300 | * return -1 on failure. |
@@ -977,7 +977,7 @@ static int tcp_oob_callback(void *object, const uint8_t *public_key, const uint8 | |||
977 | return -1; | 977 | return -1; |
978 | } | 978 | } |
979 | 979 | ||
980 | /* TODO: optimize */ | 980 | /* TODO(irungentoo): optimize */ |
981 | int connections_number = find_tcp_connection_to(tcp_c, public_key); | 981 | int connections_number = find_tcp_connection_to(tcp_c, public_key); |
982 | 982 | ||
983 | TCP_Connection_to *con_to = get_connection(tcp_c, connections_number); | 983 | TCP_Connection_to *con_to = get_connection(tcp_c, connections_number); |
diff --git a/toxcore/TCP_connection.h b/toxcore/TCP_connection.h index e0a3988e..edf9ec8f 100644 --- a/toxcore/TCP_connection.h +++ b/toxcore/TCP_connection.h | |||
@@ -115,8 +115,8 @@ int send_packet_tcp_connection(TCP_Connections *tcp_c, int connections_number, c | |||
115 | 115 | ||
116 | /* Return a random TCP connection number for use in send_tcp_onion_request. | 116 | /* Return a random TCP connection number for use in send_tcp_onion_request. |
117 | * | 117 | * |
118 | * TODO: This number is just the index of an array that the elements can | 118 | * TODO(irungentoo): This number is just the index of an array that the elements |
119 | * change without warning. | 119 | * can change without warning. |
120 | * | 120 | * |
121 | * return TCP connection number on success. | 121 | * return TCP connection number on success. |
122 | * return -1 on failure. | 122 | * return -1 on failure. |
diff --git a/toxcore/TCP_server.c b/toxcore/TCP_server.c index 13e4da45..58efe51c 100644 --- a/toxcore/TCP_server.c +++ b/toxcore/TCP_server.c | |||
@@ -669,7 +669,7 @@ static int handle_TCP_routing_req(TCP_Server *TCP_server, uint32_t con_id, const | |||
669 | other_conn->connections[other_id].status = 2; | 669 | other_conn->connections[other_id].status = 2; |
670 | other_conn->connections[other_id].index = con_id; | 670 | other_conn->connections[other_id].index = con_id; |
671 | other_conn->connections[other_id].other_id = index; | 671 | other_conn->connections[other_id].other_id = index; |
672 | //TODO: return values? | 672 | // TODO(irungentoo): return values? |
673 | send_connect_notification(con, index); | 673 | send_connect_notification(con, index); |
674 | send_connect_notification(other_conn, other_id); | 674 | send_connect_notification(other_conn, other_id); |
675 | } | 675 | } |
@@ -728,7 +728,7 @@ static int rm_connection_index(TCP_Server *TCP_server, TCP_Secure_Connection *co | |||
728 | TCP_server->accepted_connection_array[index].connections[other_id].other_id = 0; | 728 | TCP_server->accepted_connection_array[index].connections[other_id].other_id = 0; |
729 | TCP_server->accepted_connection_array[index].connections[other_id].index = 0; | 729 | TCP_server->accepted_connection_array[index].connections[other_id].index = 0; |
730 | TCP_server->accepted_connection_array[index].connections[other_id].status = 1; | 730 | TCP_server->accepted_connection_array[index].connections[other_id].status = 1; |
731 | //TODO: return values? | 731 | // TODO(irungentoo): return values? |
732 | send_disconnect_notification(&TCP_server->accepted_connection_array[index], other_id); | 732 | send_disconnect_notification(&TCP_server->accepted_connection_array[index], other_id); |
733 | } | 733 | } |
734 | 734 | ||
diff --git a/toxcore/assoc.c b/toxcore/assoc.c index df84fff5..3653a8d4 100644 --- a/toxcore/assoc.c +++ b/toxcore/assoc.c | |||
@@ -196,7 +196,7 @@ static void dist_index_bubble(Assoc *assoc, uint64_t *dist_list, size_t first, s | |||
196 | } | 196 | } |
197 | } | 197 | } |
198 | 198 | ||
199 | /* TODO: Check that there isn't a function like this elsewhere hidden. | 199 | /* TODO(irungentoo): Check that there isn't a function like this elsewhere hidden. |
200 | * E.g. the one which creates a handshake_id isn't usable for this, it must | 200 | * E.g. the one which creates a handshake_id isn't usable for this, it must |
201 | * always map the same ID to the same hash. | 201 | * always map the same ID to the same hash. |
202 | * | 202 | * |
diff --git a/toxcore/crypto_core.c b/toxcore/crypto_core.c index bcfd7e60..8f7572ab 100644 --- a/toxcore/crypto_core.c +++ b/toxcore/crypto_core.c | |||
@@ -157,7 +157,7 @@ int decrypt_data(const uint8_t *public_key, const uint8_t *secret_key, const uin | |||
157 | /* Increment the given nonce by 1. */ | 157 | /* Increment the given nonce by 1. */ |
158 | void increment_nonce(uint8_t *nonce) | 158 | void increment_nonce(uint8_t *nonce) |
159 | { | 159 | { |
160 | /* FIXME use increment_nonce_number(nonce, 1) or sodium_increment (change to little endian) | 160 | /* TODO(irungentoo): use increment_nonce_number(nonce, 1) or sodium_increment (change to little endian) |
161 | * NOTE don't use breaks inside this loop | 161 | * NOTE don't use breaks inside this loop |
162 | * In particular, make sure, as far as possible, | 162 | * In particular, make sure, as far as possible, |
163 | * that loop bounds and their potential underflow or overflow | 163 | * that loop bounds and their potential underflow or overflow |
@@ -240,7 +240,7 @@ int create_request(const uint8_t *send_public_key, const uint8_t *send_secret_ke | |||
240 | 240 | ||
241 | uint8_t *nonce = packet + 1 + crypto_box_PUBLICKEYBYTES * 2; | 241 | uint8_t *nonce = packet + 1 + crypto_box_PUBLICKEYBYTES * 2; |
242 | new_nonce(nonce); | 242 | new_nonce(nonce); |
243 | uint8_t temp[MAX_CRYPTO_REQUEST_SIZE]; // FIXME sodium_memzero before exit function | 243 | uint8_t temp[MAX_CRYPTO_REQUEST_SIZE]; // TODO(irungentoo): sodium_memzero before exit function |
244 | memcpy(temp + 1, data, length); | 244 | memcpy(temp + 1, data, length); |
245 | temp[0] = request_id; | 245 | temp[0] = request_id; |
246 | int len = encrypt_data(recv_public_key, send_secret_key, nonce, temp, length + 1, | 246 | int len = encrypt_data(recv_public_key, send_secret_key, nonce, temp, length + 1, |
@@ -281,7 +281,7 @@ int handle_request(const uint8_t *self_public_key, const uint8_t *self_secret_ke | |||
281 | 281 | ||
282 | memcpy(public_key, packet + 1 + crypto_box_PUBLICKEYBYTES, crypto_box_PUBLICKEYBYTES); | 282 | memcpy(public_key, packet + 1 + crypto_box_PUBLICKEYBYTES, crypto_box_PUBLICKEYBYTES); |
283 | const uint8_t *nonce = packet + 1 + crypto_box_PUBLICKEYBYTES * 2; | 283 | const uint8_t *nonce = packet + 1 + crypto_box_PUBLICKEYBYTES * 2; |
284 | uint8_t temp[MAX_CRYPTO_REQUEST_SIZE]; // FIXME sodium_memzero before exit function | 284 | uint8_t temp[MAX_CRYPTO_REQUEST_SIZE]; // TODO(irungentoo): sodium_memzero before exit function |
285 | int len1 = decrypt_data(public_key, self_secret_key, nonce, | 285 | int len1 = decrypt_data(public_key, self_secret_key, nonce, |
286 | packet + 1 + crypto_box_PUBLICKEYBYTES * 2 + crypto_box_NONCEBYTES, | 286 | packet + 1 + crypto_box_PUBLICKEYBYTES * 2 + crypto_box_NONCEBYTES, |
287 | length - (crypto_box_PUBLICKEYBYTES * 2 + crypto_box_NONCEBYTES + 1), temp); | 287 | length - (crypto_box_PUBLICKEYBYTES * 2 + crypto_box_NONCEBYTES + 1), temp); |
diff --git a/toxcore/friend_requests.h b/toxcore/friend_requests.h index 5fd9bf34..4a9d06de 100644 --- a/toxcore/friend_requests.h +++ b/toxcore/friend_requests.h | |||
@@ -37,7 +37,7 @@ typedef struct { | |||
37 | int (*filter_function)(const uint8_t *, void *); | 37 | int (*filter_function)(const uint8_t *, void *); |
38 | void *filter_function_userdata; | 38 | void *filter_function_userdata; |
39 | /* NOTE: The following is just a temporary fix for the multiple friend requests received at the same time problem. | 39 | /* NOTE: The following is just a temporary fix for the multiple friend requests received at the same time problem. |
40 | * TODO: Make this better (This will most likely tie in with the way we will handle spam.) | 40 | * TODO(irungentoo): Make this better (This will most likely tie in with the way we will handle spam.) |
41 | */ | 41 | */ |
42 | 42 | ||
43 | #define MAX_RECEIVED_STORED 32 | 43 | #define MAX_RECEIVED_STORED 32 |
diff --git a/toxcore/group.c b/toxcore/group.c index a85b7320..730378ea 100644 --- a/toxcore/group.c +++ b/toxcore/group.c | |||
@@ -144,7 +144,7 @@ static Group_c *get_group_c(const Group_Chats *g_c, int groupnumber) | |||
144 | * return peer index if peer is in chat. | 144 | * return peer index if peer is in chat. |
145 | * return -1 if peer is not in chat. | 145 | * return -1 if peer is not in chat. |
146 | * | 146 | * |
147 | * TODO: make this more efficient. | 147 | * TODO(irungentoo): make this more efficient. |
148 | */ | 148 | */ |
149 | 149 | ||
150 | static int peer_in_chat(const Group_c *chat, const uint8_t *real_pk) | 150 | static int peer_in_chat(const Group_c *chat, const uint8_t *real_pk) |
@@ -166,7 +166,7 @@ static int peer_in_chat(const Group_c *chat, const uint8_t *real_pk) | |||
166 | * return group number if peer is in list. | 166 | * return group number if peer is in list. |
167 | * return -1 if group is not in list. | 167 | * return -1 if group is not in list. |
168 | * | 168 | * |
169 | * TODO: make this more efficient and maybe use constant time comparisons? | 169 | * TODO(irungentoo): make this more efficient and maybe use constant time comparisons? |
170 | */ | 170 | */ |
171 | static int get_group_num(const Group_Chats *g_c, const uint8_t *identifier) | 171 | static int get_group_num(const Group_Chats *g_c, const uint8_t *identifier) |
172 | { | 172 | { |
@@ -187,7 +187,7 @@ static int get_group_num(const Group_Chats *g_c, const uint8_t *identifier) | |||
187 | * return peer number if peer is in chat. | 187 | * return peer number if peer is in chat. |
188 | * return -1 if peer is not in chat. | 188 | * return -1 if peer is not in chat. |
189 | * | 189 | * |
190 | * TODO: make this more efficient. | 190 | * TODO(irungentoo): make this more efficient. |
191 | */ | 191 | */ |
192 | static int get_peer_index(Group_c *g, uint16_t peer_number) | 192 | static int get_peer_index(Group_c *g, uint16_t peer_number) |
193 | { | 193 | { |
@@ -414,7 +414,7 @@ static int addpeer(Group_Chats *g_c, int groupnumber, const uint8_t *real_pk, co | |||
414 | return -1; | 414 | return -1; |
415 | } | 415 | } |
416 | 416 | ||
417 | //TODO | 417 | // TODO(irungentoo): |
418 | int peer_index = peer_in_chat(g, real_pk); | 418 | int peer_index = peer_in_chat(g, real_pk); |
419 | 419 | ||
420 | if (peer_index != -1) { | 420 | if (peer_index != -1) { |
@@ -656,7 +656,7 @@ static int handle_status(void *object, int friendcon_id, uint8_t status, void *u | |||
656 | set_conns_status_groups(g_c, friendcon_id, GROUPCHAT_CLOSE_ONLINE); | 656 | set_conns_status_groups(g_c, friendcon_id, GROUPCHAT_CLOSE_ONLINE); |
657 | } else { /* Went offline */ | 657 | } else { /* Went offline */ |
658 | set_conns_status_groups(g_c, friendcon_id, GROUPCHAT_CLOSE_CONNECTION); | 658 | set_conns_status_groups(g_c, friendcon_id, GROUPCHAT_CLOSE_CONNECTION); |
659 | //TODO remove timedout connections? | 659 | // TODO(irungentoo): remove timedout connections? |
660 | } | 660 | } |
661 | 661 | ||
662 | return 0; | 662 | return 0; |
@@ -703,7 +703,7 @@ static int add_conn_to_groupchat(Group_Chats *g_c, int friendcon_id, int groupnu | |||
703 | g->close[ind].type = GROUPCHAT_CLOSE_CONNECTION; | 703 | g->close[ind].type = GROUPCHAT_CLOSE_CONNECTION; |
704 | g->close[ind].number = friendcon_id; | 704 | g->close[ind].number = friendcon_id; |
705 | g->close[ind].closest = closest; | 705 | g->close[ind].closest = closest; |
706 | //TODO | 706 | // TODO(irungentoo): |
707 | friend_connection_callbacks(g_c->m->fr_c, friendcon_id, GROUPCHAT_CALLBACK_INDEX, &handle_status, &handle_packet, | 707 | friend_connection_callbacks(g_c->m->fr_c, friendcon_id, GROUPCHAT_CALLBACK_INDEX, &handle_status, &handle_packet, |
708 | &handle_lossy, g_c, friendcon_id); | 708 | &handle_lossy, g_c, friendcon_id); |
709 | 709 | ||
@@ -1374,8 +1374,9 @@ static void handle_friend_invite_packet(Messenger *m, uint32_t friendnumber, con | |||
1374 | return; | 1374 | return; |
1375 | } | 1375 | } |
1376 | 1376 | ||
1377 | uint16_t peer_number = rand(); /* TODO: what if two people enter the group at the same time and | 1377 | /* TODO(irungentoo): what if two people enter the group at the same time and |
1378 | are given the same peer_number by different nodes? */ | 1378 | are given the same peer_number by different nodes? */ |
1379 | uint16_t peer_number = rand(); | ||
1379 | 1380 | ||
1380 | unsigned int tries = 0; | 1381 | unsigned int tries = 0; |
1381 | 1382 | ||
@@ -1903,7 +1904,7 @@ int group_action_send(const Group_Chats *g_c, int groupnumber, const uint8_t *ac | |||
1903 | */ | 1904 | */ |
1904 | int send_group_lossy_packet(const Group_Chats *g_c, int groupnumber, const uint8_t *data, uint16_t length) | 1905 | int send_group_lossy_packet(const Group_Chats *g_c, int groupnumber, const uint8_t *data, uint16_t length) |
1905 | { | 1906 | { |
1906 | //TODO: length check here? | 1907 | // TODO(irungentoo): length check here? |
1907 | Group_c *g = get_group_c(g_c, groupnumber); | 1908 | Group_c *g = get_group_c(g_c, groupnumber); |
1908 | 1909 | ||
1909 | if (!g) { | 1910 | if (!g) { |
@@ -2004,7 +2005,7 @@ static void handle_message_packet_group(Group_Chats *g_c, int groupnumber, const | |||
2004 | delpeer(g_c, groupnumber, index); | 2005 | delpeer(g_c, groupnumber, index); |
2005 | } else { | 2006 | } else { |
2006 | return; | 2007 | return; |
2007 | //TODO | 2008 | // TODO(irungentoo): |
2008 | } | 2009 | } |
2009 | } | 2010 | } |
2010 | break; | 2011 | break; |
@@ -2032,7 +2033,7 @@ static void handle_message_packet_group(Group_Chats *g_c, int groupnumber, const | |||
2032 | memcpy(newmsg, msg_data, msg_data_len); | 2033 | memcpy(newmsg, msg_data, msg_data_len); |
2033 | newmsg[msg_data_len] = 0; | 2034 | newmsg[msg_data_len] = 0; |
2034 | 2035 | ||
2035 | //TODO | 2036 | // TODO(irungentoo): |
2036 | if (g_c->message_callback) { | 2037 | if (g_c->message_callback) { |
2037 | g_c->message_callback(g_c->m, groupnumber, index, newmsg, msg_data_len, g_c->message_callback_userdata); | 2038 | g_c->message_callback(g_c->m, groupnumber, index, newmsg, msg_data_len, g_c->message_callback_userdata); |
2038 | } | 2039 | } |
@@ -2049,7 +2050,7 @@ static void handle_message_packet_group(Group_Chats *g_c, int groupnumber, const | |||
2049 | memcpy(newmsg, msg_data, msg_data_len); | 2050 | memcpy(newmsg, msg_data, msg_data_len); |
2050 | newmsg[msg_data_len] = 0; | 2051 | newmsg[msg_data_len] = 0; |
2051 | 2052 | ||
2052 | //TODO | 2053 | // TODO(irungentoo): |
2053 | if (g_c->action_callback) { | 2054 | if (g_c->action_callback) { |
2054 | g_c->action_callback(g_c->m, groupnumber, index, newmsg, msg_data_len, g_c->action_callback_userdata); | 2055 | g_c->action_callback(g_c->m, groupnumber, index, newmsg, msg_data_len, g_c->action_callback_userdata); |
2055 | } | 2056 | } |
@@ -2061,7 +2062,7 @@ static void handle_message_packet_group(Group_Chats *g_c, int groupnumber, const | |||
2061 | return; | 2062 | return; |
2062 | } | 2063 | } |
2063 | 2064 | ||
2064 | send_message_all_close(g_c, groupnumber, data, length, -1/*TODO close_index*/); | 2065 | send_message_all_close(g_c, groupnumber, data, length, -1/* TODO(irungentoo) close_index */); |
2065 | } | 2066 | } |
2066 | 2067 | ||
2067 | static int handle_packet(void *object, int friendcon_id, const uint8_t *data, uint16_t length, void *userdata) | 2068 | static int handle_packet(void *object, int friendcon_id, const uint8_t *data, uint16_t length, void *userdata) |
@@ -2120,7 +2121,7 @@ static int handle_packet(void *object, int friendcon_id, const uint8_t *data, ui | |||
2120 | * return 0 if packet was not received. | 2121 | * return 0 if packet was not received. |
2121 | * return 1 if packet was received. | 2122 | * return 1 if packet was received. |
2122 | * | 2123 | * |
2123 | * TODO: test this | 2124 | * TODO(irungentoo): test this |
2124 | */ | 2125 | */ |
2125 | static unsigned int lossy_packet_not_received(Group_c *g, int peer_index, uint16_t message_number) | 2126 | static unsigned int lossy_packet_not_received(Group_c *g, int peer_index, uint16_t message_number) |
2126 | { | 2127 | { |
@@ -2416,7 +2417,7 @@ void do_groupchats(Group_Chats *g_c, void *userdata) | |||
2416 | } | 2417 | } |
2417 | } | 2418 | } |
2418 | 2419 | ||
2419 | //TODO | 2420 | // TODO(irungentoo): |
2420 | } | 2421 | } |
2421 | 2422 | ||
2422 | /* Free everything related with group chats. */ | 2423 | /* Free everything related with group chats. */ |
diff --git a/toxcore/net_crypto.c b/toxcore/net_crypto.c index a354c36b..2da8de61 100644 --- a/toxcore/net_crypto.c +++ b/toxcore/net_crypto.c | |||
@@ -505,7 +505,7 @@ static IP_Port return_ip_port_connection(Net_Crypto *c, int crypt_connection_id) | |||
505 | */ | 505 | */ |
506 | static int send_packet_to(Net_Crypto *c, int crypt_connection_id, const uint8_t *data, uint16_t length) | 506 | static int send_packet_to(Net_Crypto *c, int crypt_connection_id, const uint8_t *data, uint16_t length) |
507 | { | 507 | { |
508 | //TODO TCP, etc... | 508 | // TODO(irungentoo): TCP, etc... |
509 | Crypto_Connection *conn = get_crypto_connection(c, crypt_connection_id); | 509 | Crypto_Connection *conn = get_crypto_connection(c, crypt_connection_id); |
510 | 510 | ||
511 | if (conn == 0) { | 511 | if (conn == 0) { |
@@ -517,7 +517,7 @@ static int send_packet_to(Net_Crypto *c, int crypt_connection_id, const uint8_t | |||
517 | pthread_mutex_lock(&conn->mutex); | 517 | pthread_mutex_lock(&conn->mutex); |
518 | IP_Port ip_port = return_ip_port_connection(c, crypt_connection_id); | 518 | IP_Port ip_port = return_ip_port_connection(c, crypt_connection_id); |
519 | 519 | ||
520 | //TODO: on bad networks, direct connections might not last indefinitely. | 520 | // TODO(irungentoo): on bad networks, direct connections might not last indefinitely. |
521 | if (ip_port.ip.family != 0) { | 521 | if (ip_port.ip.family != 0) { |
522 | bool direct_connected = 0; | 522 | bool direct_connected = 0; |
523 | crypto_connection_status(c, crypt_connection_id, &direct_connected, NULL); | 523 | crypto_connection_status(c, crypt_connection_id, &direct_connected, NULL); |
@@ -532,7 +532,7 @@ static int send_packet_to(Net_Crypto *c, int crypt_connection_id, const uint8_t | |||
532 | return -1; | 532 | return -1; |
533 | } | 533 | } |
534 | 534 | ||
535 | //TODO: a better way of sending packets directly to confirm the others ip. | 535 | // TODO(irungentoo): a better way of sending packets directly to confirm the others ip. |
536 | uint64_t current_time = unix_time(); | 536 | uint64_t current_time = unix_time(); |
537 | 537 | ||
538 | if ((((UDP_DIRECT_TIMEOUT / 2) + conn->direct_send_attempt_time) > current_time && length < 96) | 538 | if ((((UDP_DIRECT_TIMEOUT / 2) + conn->direct_send_attempt_time) > current_time && length < 96) |
@@ -1403,7 +1403,7 @@ static int handle_data_packet_helper(Net_Crypto *c, int crypt_connection_id, con | |||
1403 | return -1; | 1403 | return -1; |
1404 | } | 1404 | } |
1405 | 1405 | ||
1406 | // else { /* TODO? */ } | 1406 | // else { /* TODO(irungentoo): ? */ } |
1407 | 1407 | ||
1408 | set_buffer_end(&conn->recv_array, num); | 1408 | set_buffer_end(&conn->recv_array, num); |
1409 | } else if (real_data[0] >= CRYPTO_RESERVED_PACKETS && real_data[0] < PACKET_ID_LOSSY_RANGE_START) { | 1409 | } else if (real_data[0] >= CRYPTO_RESERVED_PACKETS && real_data[0] < PACKET_ID_LOSSY_RANGE_START) { |
@@ -1595,7 +1595,7 @@ static int create_crypto_connection(Net_Crypto *c) | |||
1595 | } | 1595 | } |
1596 | } | 1596 | } |
1597 | 1597 | ||
1598 | while (1) { /* TODO: is this really the best way to do this? */ | 1598 | while (1) { /* TODO(irungentoo): is this really the best way to do this? */ |
1599 | pthread_mutex_lock(&c->connections_mutex); | 1599 | pthread_mutex_lock(&c->connections_mutex); |
1600 | 1600 | ||
1601 | if (!c->connection_use_counter) { | 1601 | if (!c->connection_use_counter) { |
@@ -1967,7 +1967,7 @@ static int tcp_data_callback(void *object, int id, const uint8_t *data, uint16_t | |||
1967 | return -1; | 1967 | return -1; |
1968 | } | 1968 | } |
1969 | 1969 | ||
1970 | //TODO detect and kill bad TCP connections. | 1970 | // TODO(irungentoo): detect and kill bad TCP connections. |
1971 | return 0; | 1971 | return 0; |
1972 | } | 1972 | } |
1973 | 1973 | ||
@@ -2034,7 +2034,7 @@ int add_tcp_relay(Net_Crypto *c, IP_Port ip_port, const uint8_t *public_key) | |||
2034 | 2034 | ||
2035 | /* Return a random TCP connection number for use in send_tcp_onion_request. | 2035 | /* Return a random TCP connection number for use in send_tcp_onion_request. |
2036 | * | 2036 | * |
2037 | * TODO: This number is just the index of an array that the elements can | 2037 | * TODO(irungentoo): This number is just the index of an array that the elements can |
2038 | * change without warning. | 2038 | * change without warning. |
2039 | * | 2039 | * |
2040 | * return TCP connection number on success. | 2040 | * return TCP connection number on success. |
@@ -2388,7 +2388,7 @@ static void send_crypto_packets(Net_Crypto *c) | |||
2388 | } else { | 2388 | } else { |
2389 | long signed int total_sent = 0, total_resent = 0; | 2389 | long signed int total_sent = 0, total_resent = 0; |
2390 | 2390 | ||
2391 | //TODO use real delay | 2391 | // TODO(irungentoo): use real delay |
2392 | unsigned int delay = (unsigned int)((conn->rtt_time / PACKET_COUNTER_AVERAGE_INTERVAL) + 0.5); | 2392 | unsigned int delay = (unsigned int)((conn->rtt_time / PACKET_COUNTER_AVERAGE_INTERVAL) + 0.5); |
2393 | unsigned int packets_set_rem_array = (CONGESTION_LAST_SENT_ARRAY_SIZE - CONGESTION_QUEUE_ARRAY_SIZE); | 2393 | unsigned int packets_set_rem_array = (CONGESTION_LAST_SENT_ARRAY_SIZE - CONGESTION_QUEUE_ARRAY_SIZE); |
2394 | 2394 | ||
@@ -2424,7 +2424,7 @@ static void send_crypto_packets(Net_Crypto *c) | |||
2424 | 2424 | ||
2425 | double send_array_ratio = (((double)npackets) / min_speed); | 2425 | double send_array_ratio = (((double)npackets) / min_speed); |
2426 | 2426 | ||
2427 | //TODO: Improve formula? | 2427 | // TODO(irungentoo): Improve formula? |
2428 | if (send_array_ratio > SEND_QUEUE_RATIO && CRYPTO_MIN_QUEUE_LENGTH < npackets) { | 2428 | if (send_array_ratio > SEND_QUEUE_RATIO && CRYPTO_MIN_QUEUE_LENGTH < npackets) { |
2429 | conn->packet_send_rate = min_speed * (1.0 / (send_array_ratio / SEND_QUEUE_RATIO)); | 2429 | conn->packet_send_rate = min_speed * (1.0 / (send_array_ratio / SEND_QUEUE_RATIO)); |
2430 | } else if (conn->last_congestion_event + CONGESTION_EVENT_TIMEOUT < temp_time) { | 2430 | } else if (conn->last_congestion_event + CONGESTION_EVENT_TIMEOUT < temp_time) { |
@@ -2680,7 +2680,7 @@ int send_lossy_cryptpacket(Net_Crypto *c, int crypt_connection_id, const uint8_t | |||
2680 | */ | 2680 | */ |
2681 | int crypto_kill(Net_Crypto *c, int crypt_connection_id) | 2681 | int crypto_kill(Net_Crypto *c, int crypt_connection_id) |
2682 | { | 2682 | { |
2683 | while (1) { /* TODO: is this really the best way to do this? */ | 2683 | while (1) { /* TODO(irungentoo): is this really the best way to do this? */ |
2684 | pthread_mutex_lock(&c->connections_mutex); | 2684 | pthread_mutex_lock(&c->connections_mutex); |
2685 | 2685 | ||
2686 | if (!c->connection_use_counter) { | 2686 | if (!c->connection_use_counter) { |
@@ -2759,7 +2759,7 @@ void new_keys(Net_Crypto *c) | |||
2759 | /* Save the public and private keys to the keys array. | 2759 | /* Save the public and private keys to the keys array. |
2760 | * Length must be crypto_box_PUBLICKEYBYTES + crypto_box_SECRETKEYBYTES. | 2760 | * Length must be crypto_box_PUBLICKEYBYTES + crypto_box_SECRETKEYBYTES. |
2761 | * | 2761 | * |
2762 | * TODO: Save only secret key. | 2762 | * TODO(irungentoo): Save only secret key. |
2763 | */ | 2763 | */ |
2764 | void save_keys(const Net_Crypto *c, uint8_t *keys) | 2764 | void save_keys(const Net_Crypto *c, uint8_t *keys) |
2765 | { | 2765 | { |
@@ -2857,7 +2857,7 @@ static void kill_timedout(Net_Crypto *c, void *userdata) | |||
2857 | #if 0 | 2857 | #if 0 |
2858 | 2858 | ||
2859 | if (conn->status == CRYPTO_CONN_ESTABLISHED) { | 2859 | if (conn->status == CRYPTO_CONN_ESTABLISHED) { |
2860 | //TODO: add a timeout here? | 2860 | // TODO(irungentoo): add a timeout here? |
2861 | } | 2861 | } |
2862 | 2862 | ||
2863 | #endif | 2863 | #endif |
diff --git a/toxcore/network.c b/toxcore/network.c index e42c962b..b472ed31 100644 --- a/toxcore/network.c +++ b/toxcore/network.c | |||
@@ -494,14 +494,15 @@ int networking_at_startup(void) | |||
494 | return 0; | 494 | return 0; |
495 | } | 495 | } |
496 | 496 | ||
497 | /* TODO: Put this somewhere | 497 | /* TODO(irungentoo): Put this somewhere */ |
498 | #if 0 | ||
498 | static void at_shutdown(void) | 499 | static void at_shutdown(void) |
499 | { | 500 | { |
500 | #if defined(_WIN32) || defined(__WIN32__) || defined (WIN32) | 501 | #if defined(_WIN32) || defined(__WIN32__) || defined (WIN32) |
501 | WSACleanup(); | 502 | WSACleanup(); |
502 | #endif | 503 | #endif |
503 | } | 504 | } |
504 | */ | 505 | #endif |
505 | 506 | ||
506 | /* Initialize networking. | 507 | /* Initialize networking. |
507 | * Added for reverse compatibility with old new_networking calls. | 508 | * Added for reverse compatibility with old new_networking calls. |
@@ -873,7 +874,7 @@ void ipport_copy(IP_Port *target, const IP_Port *source) | |||
873 | * writes error message into the buffer on error | 874 | * writes error message into the buffer on error |
874 | */ | 875 | */ |
875 | /* there would be INET6_ADDRSTRLEN, but it might be too short for the error message */ | 876 | /* there would be INET6_ADDRSTRLEN, but it might be too short for the error message */ |
876 | static char addresstext[96]; // FIXME magic number. Why not INET6_ADDRSTRLEN ? | 877 | static char addresstext[96]; // TODO(irungentoo): magic number. Why not INET6_ADDRSTRLEN ? |
877 | const char *ip_ntoa(const IP *ip) | 878 | const char *ip_ntoa(const IP *ip) |
878 | { | 879 | { |
879 | if (ip) { | 880 | if (ip) { |
diff --git a/toxcore/onion_client.c b/toxcore/onion_client.c index 04822cc1..316ed3d1 100644 --- a/toxcore/onion_client.c +++ b/toxcore/onion_client.c | |||
@@ -203,7 +203,7 @@ static int is_path_used(const Onion_Client_Paths *onion_paths, const Node_format | |||
203 | continue; | 203 | continue; |
204 | } | 204 | } |
205 | 205 | ||
206 | // TODO: do we really have to check it with the last node? | 206 | // TODO(irungentoo): do we really have to check it with the last node? |
207 | if (ipport_equal(&onion_paths->paths[i].ip_port1, &nodes[ONION_PATH_LENGTH - 1].ip_port)) { | 207 | if (ipport_equal(&onion_paths->paths[i].ip_port1, &nodes[ONION_PATH_LENGTH - 1].ip_port)) { |
208 | return i; | 208 | return i; |
209 | } | 209 | } |
@@ -228,8 +228,8 @@ static bool path_timed_out(Onion_Client_Paths *onion_paths, uint32_t pathnum) | |||
228 | * return -1 on failure | 228 | * return -1 on failure |
229 | * return 0 on success | 229 | * return 0 on success |
230 | * | 230 | * |
231 | * TODO: Make this function better, it currently probably is vulnerable to some attacks that | 231 | * TODO(irungentoo): Make this function better, it currently probably is |
232 | * could de anonimize us. | 232 | * vulnerable to some attacks that could deanonimize us. |
233 | */ | 233 | */ |
234 | static int random_path(const Onion_Client *onion_c, Onion_Client_Paths *onion_paths, uint32_t pathnum, Onion_Path *path) | 234 | static int random_path(const Onion_Client *onion_c, Onion_Client_Paths *onion_paths, uint32_t pathnum, Onion_Path *path) |
235 | { | 235 | { |
@@ -558,7 +558,7 @@ static int client_add_to_list(Onion_Client *onion_c, uint32_t num, const uint8_t | |||
558 | memcpy(list_nodes[index].public_key, public_key, crypto_box_PUBLICKEYBYTES); | 558 | memcpy(list_nodes[index].public_key, public_key, crypto_box_PUBLICKEYBYTES); |
559 | list_nodes[index].ip_port = ip_port; | 559 | list_nodes[index].ip_port = ip_port; |
560 | 560 | ||
561 | //TODO: remove this and find a better source of nodes to use for paths. | 561 | // TODO(irungentoo): remove this and find a better source of nodes to use for paths. |
562 | onion_add_path_node(onion_c, ip_port, public_key); | 562 | onion_add_path_node(onion_c, ip_port, public_key); |
563 | 563 | ||
564 | if (is_stored == 1) { | 564 | if (is_stored == 1) { |
@@ -718,7 +718,7 @@ static int handle_announce_response(void *object, IP_Port source, const uint8_t | |||
718 | } | 718 | } |
719 | } | 719 | } |
720 | 720 | ||
721 | //TODO: LAN vs non LAN ips?, if we are connected only to LAN, are we offline? | 721 | // TODO(irungentoo): LAN vs non LAN ips?, if we are connected only to LAN, are we offline? |
722 | onion_c->last_packet_recv = unix_time(); | 722 | onion_c->last_packet_recv = unix_time(); |
723 | return 0; | 723 | return 0; |
724 | } | 724 | } |
diff --git a/toxcore/tox.c b/toxcore/tox.c index 463238b5..b9bab973 100644 --- a/toxcore/tox.c +++ b/toxcore/tox.c | |||
@@ -250,7 +250,7 @@ Tox *tox_new(const struct Tox_Options *options, TOX_ERR_NEW *error) | |||
250 | 250 | ||
251 | if (!addr_resolve_or_parse_ip(options->proxy_host, &m_options.proxy_info.ip_port.ip, NULL)) { | 251 | if (!addr_resolve_or_parse_ip(options->proxy_host, &m_options.proxy_info.ip_port.ip, NULL)) { |
252 | SET_ERROR_PARAMETER(error, TOX_ERR_NEW_PROXY_BAD_HOST); | 252 | SET_ERROR_PARAMETER(error, TOX_ERR_NEW_PROXY_BAD_HOST); |
253 | //TODO: TOX_ERR_NEW_PROXY_NOT_FOUND if domain. | 253 | // TODO(irungentoo): TOX_ERR_NEW_PROXY_NOT_FOUND if domain. |
254 | return NULL; | 254 | return NULL; |
255 | } | 255 | } |
256 | 256 | ||
@@ -527,7 +527,7 @@ bool tox_self_set_name(Tox *tox, const uint8_t *name, size_t length, TOX_ERR_SET | |||
527 | Messenger *m = tox; | 527 | Messenger *m = tox; |
528 | 528 | ||
529 | if (setname(m, name, length) == 0) { | 529 | if (setname(m, name, length) == 0) { |
530 | //TODO: function to set different per group names? | 530 | // TODO(irungentoo): function to set different per group names? |
531 | send_name_all_groups(m->group_chat_object); | 531 | send_name_all_groups(m->group_chat_object); |
532 | SET_ERROR_PARAMETER(error, TOX_ERR_SET_INFO_OK); | 532 | SET_ERROR_PARAMETER(error, TOX_ERR_SET_INFO_OK); |
533 | return 1; | 533 | return 1; |
@@ -672,7 +672,7 @@ bool tox_friend_delete(Tox *tox, uint32_t friend_number, TOX_ERR_FRIEND_DELETE * | |||
672 | Messenger *m = tox; | 672 | Messenger *m = tox; |
673 | int ret = m_delfriend(m, friend_number); | 673 | int ret = m_delfriend(m, friend_number); |
674 | 674 | ||
675 | //TODO handle if realloc fails? | 675 | // TODO(irungentoo): handle if realloc fails? |
676 | if (ret == -1) { | 676 | if (ret == -1) { |
677 | SET_ERROR_PARAMETER(error, TOX_ERR_FRIEND_DELETE_FRIEND_NOT_FOUND); | 677 | SET_ERROR_PARAMETER(error, TOX_ERR_FRIEND_DELETE_FRIEND_NOT_FOUND); |
678 | return 0; | 678 | return 0; |
@@ -749,7 +749,7 @@ void tox_self_get_friend_list(const Tox *tox, uint32_t *friend_list) | |||
749 | { | 749 | { |
750 | if (friend_list) { | 750 | if (friend_list) { |
751 | const Messenger *m = tox; | 751 | const Messenger *m = tox; |
752 | //TODO: size parameter? | 752 | // TODO(irungentoo): size parameter? |
753 | copy_friendlist(m, friend_list, tox_self_get_friend_list_size(tox)); | 753 | copy_friendlist(m, friend_list, tox_self_get_friend_list_size(tox)); |
754 | } | 754 | } |
755 | } | 755 | } |
@@ -816,7 +816,7 @@ bool tox_friend_get_status_message(const Tox *tox, uint32_t friend_number, uint8 | |||
816 | } | 816 | } |
817 | 817 | ||
818 | const Messenger *m = tox; | 818 | const Messenger *m = tox; |
819 | //TODO: size parameter? | 819 | // TODO(irungentoo): size parameter? |
820 | int ret = m_copy_statusmessage(m, friend_number, status_message, m_get_statusmessage_size(m, friend_number)); | 820 | int ret = m_copy_statusmessage(m, friend_number, status_message, m_get_statusmessage_size(m, friend_number)); |
821 | 821 | ||
822 | if (ret == -1) { | 822 | if (ret == -1) { |
diff --git a/toxcore/tox.h b/toxcore/tox.h index 60110ea8..a8488aeb 100644 --- a/toxcore/tox.h +++ b/toxcore/tox.h | |||
@@ -282,7 +282,7 @@ uint32_t tox_max_friend_request_length(void); | |||
282 | uint32_t tox_max_message_length(void); | 282 | uint32_t tox_max_message_length(void); |
283 | 283 | ||
284 | /** | 284 | /** |
285 | * Maximum size of custom packets. TODO: should be LENGTH? | 285 | * Maximum size of custom packets. TODO(iphydf): should be LENGTH? |
286 | */ | 286 | */ |
287 | #define TOX_MAX_CUSTOM_PACKET_SIZE 1373 | 287 | #define TOX_MAX_CUSTOM_PACKET_SIZE 1373 |
288 | 288 | ||
@@ -928,7 +928,7 @@ typedef void tox_self_connection_status_cb(Tox *tox, TOX_CONNECTION connection_s | |||
928 | * amounts of time. Clients should therefore not immediately bootstrap on | 928 | * amounts of time. Clients should therefore not immediately bootstrap on |
929 | * receiving a disconnect. | 929 | * receiving a disconnect. |
930 | * | 930 | * |
931 | * TODO: how long should a client wait before bootstrapping again? | 931 | * TODO(iphydf): how long should a client wait before bootstrapping again? |
932 | */ | 932 | */ |
933 | void tox_callback_self_connection_status(Tox *tox, tox_self_connection_status_cb *callback); | 933 | void tox_callback_self_connection_status(Tox *tox, tox_self_connection_status_cb *callback); |
934 | 934 | ||
diff --git a/toxdns/toxdns.c b/toxdns/toxdns.c index 65da4908..c420c944 100644 --- a/toxdns/toxdns.c +++ b/toxdns/toxdns.c | |||
@@ -147,7 +147,7 @@ int tox_generate_dns3_string(void *dns3_object, uint8_t *string, uint16_t string | |||
147 | } | 147 | } |
148 | 148 | ||
149 | if (end_len != string - old_str) { | 149 | if (end_len != string - old_str) { |
150 | // FIXME: This currently has no access to a logger. | 150 | // TODO(iphydf): This currently has no access to a logger. |
151 | LOGGER_ERROR(NULL, "tox_generate_dns3_string Fail, %u != %lu\n", end_len, string - old_str); | 151 | LOGGER_ERROR(NULL, "tox_generate_dns3_string Fail, %u != %lu\n", end_len, string - old_str); |
152 | return -1; | 152 | return -1; |
153 | } | 153 | } |