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.
This commit is contained in:
iphydf 2016-09-12 16:48:35 +01:00
parent 37c041f815
commit 1494e474dd
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9
32 changed files with 144 additions and 127 deletions

View File

@ -17,7 +17,7 @@
START_TEST(test_basics)
{
/* TODO: real test */
/* TODO(irungentoo): real test */
uint8_t id[crypto_box_PUBLICKEYBYTES] = {1};
Assoc *assoc = new_Assoc_default(NULL, id);
ck_assert_msg(assoc != NULL, "failed to create default assoc");
@ -61,7 +61,7 @@ END_TEST
START_TEST(test_fillup)
{
/* TODO: real test */
/* TODO(irungentoo): real test */
int i, j;
uint8_t id[crypto_box_PUBLICKEYBYTES];
//uint32_t a = current_time();

View File

@ -120,7 +120,8 @@ START_TEST(test_m_delfriend)
REALLY_BIG_NUMBER);
}
END_TEST
/*
#if 0
START_TEST(test_m_addfriend)
{
char *good_data = "test";
@ -129,30 +130,34 @@ START_TEST(test_m_addfriend)
int good_len = strlen(good_data);
int bad_len = strlen(bad_data);
int really_bad_len = (MAX_CRYPTO_PACKET_SIZE - crypto_box_PUBLICKEYBYTES
- crypto_box_NONCEBYTES - crypto_box_BOXZEROBYTES
+ crypto_box_ZEROBYTES + 100); */
/* TODO: Update this properly to latest master
if(m_addfriend(m, (uint8_t *)friend_id, (uint8_t *)good_data, really_bad_len) != FAERR_TOOLONG)
- crypto_box_NONCEBYTES - crypto_box_BOXZEROBYTES
+ crypto_box_ZEROBYTES + 100);
/* TODO(irungentoo): Update this properly to latest master */
if (m_addfriend(m, (uint8_t *)friend_id, (uint8_t *)good_data, really_bad_len) != FAERR_TOOLONG) {
ck_abort_msg("m_addfriend did NOT catch the following length: %d\n", really_bad_len);
*/
/* this will return an error if the original m_addfriend_norequest() failed */
/* if(m_addfriend(m, (uint8_t *)friend_id, (uint8_t *)good_data, good_len) != FAERR_ALREADYSENT)
}
/* this will return an error if the original m_addfriend_norequest() failed */
if (m_addfriend(m, (uint8_t *)friend_id, (uint8_t *)good_data, good_len) != FAERR_ALREADYSENT) {
ck_abort_msg("m_addfriend did NOT catch adding a friend we already have.\n"
"(this can be caused by the error of m_addfriend_norequest in"
" the beginning of the suite)\n");
}
if(m_addfriend(m, (uint8_t *)good_id_b, (uint8_t *)bad_data, bad_len) != FAERR_NOMESSAGE)
if (m_addfriend(m, (uint8_t *)good_id_b, (uint8_t *)bad_data, bad_len) != FAERR_NOMESSAGE) {
ck_abort_msg("m_addfriend did NOT catch the following length: %d\n", bad_len);
*/
/* this should REALLY return an error */
/*
* TODO: validate client_id in m_addfriend?
if(m_addfriend((uint8_t *)bad_id, (uint8_t *)good_data, good_len) >= 0)
ck_abort_msg("The following ID passed through "
"m_addfriend without an error:\n'%s'\n", bad_id_str);
}
/* this should REALLY return an error */
/* TODO(irungentoo): validate client_id in m_addfriend? */
if (m_addfriend((uint8_t *)bad_id, (uint8_t *)good_data, good_len) >= 0) {
ck_abort_msg("The following ID passed through "
"m_addfriend without an error:\n'%s'\n", bad_id_str);
}
}
END_TEST */
END_TEST
#endif
START_TEST(test_setname)
{

View File

@ -251,7 +251,7 @@ START_TEST(test_AV_flows)
} \
BobCC.incoming = false; \
} else { \
/* TODO rtp */ \
/* TODO(mannol): rtp */ \
\
if (time(NULL) - start_time >= 1) { \
\

View File

@ -10,7 +10,7 @@ the invite or responds with a response packet if he wants to join the chat. The
of groupchat (text only, A/V) the friend is being invited to.
TODO: write more of this.
TODO(irungentoo): write more of this.
## Protocol

View File

@ -267,7 +267,7 @@ const MAX_FRIEND_REQUEST_LENGTH = 1016;
const MAX_MESSAGE_LENGTH = 1372;
/**
* Maximum size of custom packets. TODO: should be LENGTH?
* Maximum size of custom packets. TODO(iphydf): should be LENGTH?
*/
const MAX_CUSTOM_PACKET_SIZE = 1373;
@ -786,7 +786,7 @@ inline namespace self {
* amounts of time. Clients should therefore not immediately bootstrap on
* receiving a disconnect.
*
* TODO: how long should a client wait before bootstrapping again?
* TODO(iphydf): how long should a client wait before bootstrapping again?
*/
event connection_status const {
/**

View File

@ -652,7 +652,7 @@ namespace video {
%{
/**
* NOTE Compatibility with old toxav group calls TODO remove
* NOTE Compatibility with old toxav group calls. TODO(iphydf): remove
*/
/* Create a new toxav group.
*

View File

@ -153,7 +153,7 @@ static void print_friendlist(DHT *dht)
}
}
#if 0 /* slvrTODO: */
#if 0 /* TODO(slvr): */
static void printpacket(uint8_t *data, uint32_t length, IP_Port ip_port)
{
uint32_t i;
@ -232,7 +232,7 @@ int main(int argc, char *argv[])
return 1;
}
#if 0 /* slvrTODO: */
#if 0 /* TODO(slvr): */
IP_Port ip_port;
uint8_t data[MAX_UDP_PACKET_SIZE];
uint32_t length;
@ -241,7 +241,7 @@ int main(int argc, char *argv[])
while (1) {
do_DHT(dht);
#if 0 /* slvrTODO: */
#if 0 /* TODO(slvr): */
while (receivepacket(&ip_port, data, &length) != -1) {
if (DHT_handlepacket(data, length, ip_port) && friendreq_handlepacket(data, length, ip_port)) {

View File

@ -63,7 +63,7 @@ static void print_message(Messenger *m, uint32_t friendnumber, unsigned int type
m_send_message_generic(m, friendnumber, type, (const uint8_t *)"Test1", 6, 0);
}
/* FIXME needed as print_request has to match the interface expected by
/* TODO(irungentoo): needed as print_request has to match the interface expected by
* networking_requesthandler and so cannot take a Messenger * */
static Messenger *m;

View File

@ -131,7 +131,7 @@ void ac_iterate(ACSession *ac)
return;
}
/* TODO fix this and jitter buffering */
/* TODO(mannol): fix this and jitter buffering */
/* Enough space for the maximum frame size (120 ms 48 KHz stereo audio) */
int16_t tmp[5760 * 2];

View File

@ -552,9 +552,9 @@ int group_send_audio(Group_Chats *g_c, int groupnumber, const int16_t *pcm, unsi
group_av->audio_sample_rate = sample_rate;
if (channels == 1) {
group_av->audio_bitrate = 32000; //TODO: add way of adjusting bitrate
group_av->audio_bitrate = 32000; // TODO(mannol): add way of adjusting bitrate
} else {
group_av->audio_bitrate = 64000; //TODO: add way of adjusting bitrate
group_av->audio_bitrate = 64000; // TODO(mannol): add way of adjusting bitrate
}
if (recreate_encoder(group_av) == -1) {

View File

@ -1033,7 +1033,7 @@ bool audio_bit_rate_invalid(uint32_t bit_rate)
bool video_bit_rate_invalid(uint32_t bit_rate)
{
(void) bit_rate;
/* TODO: If anyone knows the answer to this one please fill it up */
/* TODO(mannol): If anyone knows the answer to this one please fill it up */
return false;
}
bool invoke_call_state_callback(ToxAV *av, uint32_t friend_number, uint32_t state)

View File

@ -777,7 +777,7 @@ typedef void toxav_video_receive_frame_cb(ToxAV *av, uint32_t friend_number, uin
void toxav_callback_video_receive_frame(ToxAV *av, toxav_video_receive_frame_cb *callback, void *user_data);
/**
* NOTE Compatibility with old toxav group calls TODO remove
* NOTE Compatibility with old toxav group calls. TODO(iphydf): remove
*/
/* Create a new toxav group.
*

View File

@ -77,9 +77,11 @@ VCSession *vc_new(Logger *log, ToxAV *av, uint32_t friend_number, toxav_video_re
cfg.g_w = 800;
cfg.g_h = 600;
cfg.g_pass = VPX_RC_ONE_PASS;
/* FIXME If we set error resilience the app will crash due to bug in vp8.
Perhaps vp9 has solved it?*/
// cfg.g_error_resilient = VPX_ERROR_RESILIENT_DEFAULT | VPX_ERROR_RESILIENT_PARTITIONS;
/* TODO(mannol): If we set error resilience the app will crash due to bug in vp8.
Perhaps vp9 has solved it?*/
#if 0
cfg.g_error_resilient = VPX_ERROR_RESILIENT_DEFAULT | VPX_ERROR_RESILIENT_PARTITIONS;
#endif
cfg.g_lag_in_frames = 0;
cfg.kf_min_dist = 0;
cfg.kf_max_dist = 48;

View File

@ -243,7 +243,7 @@ static int pack_ip_port(uint8_t *data, uint16_t length, const IP_Port *ip_port)
uint8_t net_family;
if (ip_port->ip.family == AF_INET) {
// FIXME use functions to convert endianness
// TODO(irungentoo): use functions to convert endianness
ipv6 = 0;
net_family = TOX_AF_INET;
} 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
/* Check if client with public_key is already in list of length length.
* If it is then set its corresponding timestamp to current time.
* If the id is already in the list with a different ip_port, update it.
* TODO: Maybe optimize this.
* TODO(irungentoo): Maybe optimize this.
*
* return True(1) or False(0)
*/
@ -482,7 +482,7 @@ static int client_or_ip_port_in_list(Logger *log, Client_data *list, uint16_t le
/* public_key not in list yet: see if we can find an identical ip_port, in
* that case we kill the old public_key by overwriting it with the new one
* TODO: maybe we SHOULDN'T do that if that public_key is in a friend_list
* TODO(irungentoo): maybe we SHOULDN'T do that if that public_key is in a friend_list
* and the one who is the actual friend's public_key/address set? */
for (i = 0; i < length; ++i) {
/* 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
return 0;
}
/*TODO: change this to 7 when done*/
/* TODO(irungentoo): change this to 7 when done*/
#define HARDENING_ALL_OK 2
/* return 0 if not.
* 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_
/* Find MAX_SENT_NODES nodes closest to the public_key for the send nodes request:
* put them in the nodes_list and return how many were found.
*
* TODO: For the love of based <your favorite deity, in doubt use "love"> make
* this function cleaner and much more efficient.
* TODO(irungentoo): For the love of based <your favorite deity, in doubt use
* "love"> make this function cleaner and much more efficient.
*
* want_good : do we want only good nodes as checked with the hardening returned or not?
*/
@ -669,12 +669,17 @@ static int get_somewhat_close_nodes(const DHT *dht, const uint8_t *public_key, N
get_close_nodes_inner(public_key, nodes_list, sa_family,
dht->close_clientlist, LCLIENT_LIST, &num_nodes, is_LAN, 0);
/*TODO uncomment this when hardening is added to close friend clients
for (i = 0; i < dht->num_friends; ++i)
get_close_nodes_inner(dht, public_key, nodes_list, sa_family,
dht->friends_list[i].client_list, MAX_FRIEND_CLIENTS,
&num_nodes, is_LAN, want_good);
*/
/* TODO(irungentoo): uncomment this when hardening is added to close friend clients */
#if 0
for (i = 0; i < dht->num_friends; ++i) {
get_close_nodes_inner(dht, public_key, nodes_list, sa_family,
dht->friends_list[i].client_list, MAX_FRIEND_CLIENTS,
&num_nodes, is_LAN, want_good);
}
#endif
for (i = 0; i < dht->num_friends; ++i) {
get_close_nodes_inner(public_key, nodes_list, sa_family,
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
return get_somewhat_close_nodes(dht, public_key, nodes_list, sa_family, is_LAN, want_good);
#ifdef ENABLE_ASSOC_DHT
//TODO: assoc, sa_family 0 (don't care if ipv4 or ipv6) support.
// TODO(irungentoo): assoc, sa_family 0 (don't care if ipv4 or ipv6) support.
Client_data *result[MAX_SENT_NODES];
Assoc_close_entries request;
@ -970,7 +975,7 @@ static unsigned int ping_node_from_getnodes_ok(DHT *dht, const uint8_t *public_k
dht->to_bootstrap[dht->num_to_bootstrap].ip_port = ip_port;
++dht->num_to_bootstrap;
} else {
//TODO: ipv6 vs v4
// TODO(irungentoo): ipv6 vs v4
add_to_list(dht->to_bootstrap, MAX_CLOSE_TO_BOOTSTRAP_NODES, public_key, ip_port, dht->self_public_key);
}
}
@ -1536,7 +1541,7 @@ int DHT_delfriend(DHT *dht, const uint8_t *public_key, uint16_t lock_count)
return 0;
}
/* TODO: Optimize this. */
/* TODO(irungentoo): Optimize this. */
int DHT_getfriendip(const DHT *dht, const uint8_t *public_key, IP_Port *ip_port)
{
uint32_t i, j;
@ -2113,7 +2118,7 @@ static void punch_holes(DHT *dht, IP ip, uint16_t *port_list, uint16_t numports,
send_ping_request(dht->ping, pinging, dht->friends_list[friend_num].public_key);
} else {
for (i = dht->friends_list[friend_num].nat.punching_index; i != top; ++i) {
/* TODO: Improve port guessing algorithm. */
/* TODO(irungentoo): Improve port guessing algorithm. */
uint16_t port = port_list[(i / 2) % numports] + (i / (2 * numports)) * ((i % 2) ? -1 : 1);
IP_Port pinging;
ip_copy(&pinging.ip, &ip);
@ -2246,7 +2251,7 @@ static int send_hardening_getnode_res(const DHT *dht, const Node_format *sendto,
return sendpacket(dht->net, sendto->ip_port, packet, len);
}
/* TODO: improve */
/* TODO(irungentoo): improve */
static IPPTsPng *get_closelist_IPPTsPng(DHT *dht, const uint8_t *public_key, sa_family_t sa_family)
{
uint32_t i;
@ -2270,7 +2275,7 @@ static IPPTsPng *get_closelist_IPPTsPng(DHT *dht, const uint8_t *public_key, sa_
/*
* check how many nodes in nodes are also present in the closelist.
* TODO: make this function better.
* TODO(irungentoo): make this function better.
*/
static uint32_t have_nodes_closelist(DHT *dht, Node_format *nodes, uint16_t num)
{
@ -2340,7 +2345,7 @@ static int handle_hardening(void *object, IP_Port source, const uint8_t *source_
Node_format nodes[MAX_SENT_NODES];
int num_nodes = unpack_nodes(nodes, MAX_SENT_NODES, 0, packet + 1 + crypto_box_PUBLICKEYBYTES, length_nodes, 0);
/* TODO: MAX_SENT_NODES nodes should be returned at all times
/* TODO(irungentoo): MAX_SENT_NODES nodes should be returned at all times
(right now we have a small network size so it could cause problems for testing and etc..) */
if (num_nodes <= 0) {
return 1;
@ -2376,7 +2381,7 @@ static int handle_hardening(void *object, IP_Port source, const uint8_t *source_
#if DHT_HARDENING
/* Return a random node from all the nodes we are connected to.
* TODO: improve this function.
* TODO(irungentoo): improve this function.
*/
static Node_format random_node(DHT *dht, sa_family_t sa_family)
{
@ -2515,7 +2520,7 @@ static void do_hardening(DHT *dht)
to_test.ip_port = cur_iptspng->ip_port;
memcpy(to_test.public_key, public_key, crypto_box_PUBLICKEYBYTES);
//TODO: The search id should maybe not be ours?
// TODO(irungentoo): The search id should maybe not be ours?
if (send_hardening_getnode_req(dht, &rand_node, &to_test, dht->self_public_key) > 0) {
memcpy(cur_iptspng->hardening.send_nodes_pingedid, rand_node.public_key, crypto_box_PUBLICKEYBYTES);
cur_iptspng->hardening.send_nodes_timestamp = unix_time();
@ -2527,7 +2532,7 @@ static void do_hardening(DHT *dht)
}
}
//TODO: add the 2 other testers.
// TODO(irungentoo): add the 2 other testers.
}
}
#endif
@ -2681,7 +2686,7 @@ void kill_DHT(DHT *dht)
}
/* new DHT format for load/save, more robust and forward compatible */
//TODO: Move this closer to Messenger.
// TODO(irungentoo): Move this closer to Messenger.
#define DHT_STATE_COOKIE_GLOBAL 0x159000d
#define DHT_STATE_COOKIE_TYPE 0x11ce

View File

@ -325,7 +325,7 @@ bool node_addable_to_close_list(DHT *dht, const uint8_t *public_key, IP_Port ip_
*
* sa_family = family (IPv4 or IPv6) (0 if we don't care)?
* is_LAN = return some LAN ips (true or false)
* want_good = do we want tested nodes or not? (TODO)
* want_good = do we want tested nodes or not? (TODO(irungentoo))
*
* return the number of nodes returned.
*

View File

@ -168,7 +168,7 @@ static void fetch_broadcast_info(uint16_t port)
close(sock);
}
#else //TODO: Other platforms?
#else // TODO(irungentoo): Other platforms?
static void fetch_broadcast_info(uint16_t port)
{

View File

@ -1449,7 +1449,8 @@ int file_data(const Messenger *m, int32_t friendnumber, uint32_t filenumber, uin
return -7;
}
/* Prevent file sending from filling up the entire buffer preventing messages from being sent. TODO: remove */
/* Prevent file sending from filling up the entire buffer preventing messages from being sent.
* TODO(irungentoo): remove */
if (crypto_num_free_sendqueue_slots(m->net_crypto, friend_connection_crypt_connection_id(m->fr_c,
m->friendlist[friendnumber].friendcon_id)) < MIN_SLOTS_FREE) {
return -6;
@ -1458,7 +1459,7 @@ int file_data(const Messenger *m, int32_t friendnumber, uint32_t filenumber, uin
int64_t ret = send_file_data_packet(m, friendnumber, filenumber, data, length);
if (ret != -1) {
//TODO record packet ids to check if other received complete file.
// TODO(irungentoo): record packet ids to check if other received complete file.
ft->transferred += length;
if (ft->slots_allocated) {
@ -1541,7 +1542,7 @@ static void do_reqchunk_filecb(Messenger *m, int32_t friendnumber, void *userdat
}
}
/* TODO: if file is too slow, switch to the next. */
/* TODO(irungentoo): if file is too slow, switch to the next. */
if (ft->slots_allocated > (unsigned int)free_slots) {
free_slots = 0;
} else {
@ -1600,7 +1601,7 @@ static void break_files(const Messenger *m, int32_t friendnumber)
{
uint32_t i;
//TODO: Inform the client which file transfers get killed with a callback?
// TODO(irungentoo): Inform the client which file transfers get killed with a callback?
for (i = 0; i < MAX_CONCURRENT_FILE_PIPES; ++i) {
if (m->friendlist[friendnumber].file_sending[i].status != FILESTATUS_NONE) {
m->friendlist[friendnumber].file_sending[i].status = FILESTATUS_NONE;
@ -2438,7 +2439,7 @@ static char *ID2String(const uint8_t *pk)
}
/* Minimum messenger run interval in ms
TODO: A/V */
TODO(mannol): A/V */
#define MIN_RUN_INTERVAL 50
/* 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)
net_to_host(last_seen_time, sizeof(uint64_t));
memcpy(&m->friendlist[fnum].last_seen_time, last_seen_time, sizeof(uint64_t));
} else if (temp.status != 0) {
/* TODO: This is not a good way to do this. */
/* TODO(irungentoo): This is not a good way to do this. */
uint8_t address[FRIEND_ADDRESS_SIZE];
id_copy(address, temp.real_pk);
memcpy(address + crypto_box_PUBLICKEYBYTES, &(temp.friendrequest_nospam), sizeof(uint32_t));

View File

@ -31,7 +31,7 @@
#include "logger.h"
#define MAX_NAME_LENGTH 128
/* TODO: this must depend on other variable. */
/* TODO(irungentoo): this must depend on other variable. */
#define MAX_STATUSMESSAGE_LENGTH 1007
/* Used for TCP relays in Messenger struct (may need to be % 2 == 0)*/
#define NUM_SAVED_TCP_RELAYS 8
@ -278,7 +278,9 @@ void getaddress(const Messenger *m, uint8_t *address);
/* Add a friend.
* Set the data that will be sent along with friend request.
* 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.
* 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(irungentoo): add checksum.
* data is the data and length is the length.
*
* return the friend number if success.

View File

@ -152,7 +152,7 @@ static int socks5_read_handshake_response(TCP_Client_Connection *TCP_conn)
return 0;
}
if (data[0] == 5 && data[1] == 0) { // FIXME magic numbers
if (data[0] == 5 && data[1] == 0) { // TODO(irungentoo): magic numbers
return 1;
}

View File

@ -223,8 +223,8 @@ int send_packet_tcp_connection(TCP_Connections *tcp_c, int connections_number, c
return -1;
}
//TODO: detect and kill bad relays.
//TODO: thread safety?
// TODO(irungentoo): detect and kill bad relays.
// TODO(irungentoo): thread safety?
unsigned int i;
int ret = -1;
@ -293,8 +293,8 @@ int send_packet_tcp_connection(TCP_Connections *tcp_c, int connections_number, c
/* Return a random TCP connection number for use in send_tcp_onion_request.
*
* TODO: This number is just the index of an array that the elements can
* change without warning.
* TODO(irungentoo): This number is just the index of an array that the elements
* can change without warning.
*
* return TCP connection number on success.
* return -1 on failure.
@ -977,7 +977,7 @@ static int tcp_oob_callback(void *object, const uint8_t *public_key, const uint8
return -1;
}
/* TODO: optimize */
/* TODO(irungentoo): optimize */
int connections_number = find_tcp_connection_to(tcp_c, public_key);
TCP_Connection_to *con_to = get_connection(tcp_c, connections_number);

View File

@ -115,8 +115,8 @@ int send_packet_tcp_connection(TCP_Connections *tcp_c, int connections_number, c
/* Return a random TCP connection number for use in send_tcp_onion_request.
*
* TODO: This number is just the index of an array that the elements can
* change without warning.
* TODO(irungentoo): This number is just the index of an array that the elements
* can change without warning.
*
* return TCP connection number on success.
* return -1 on failure.

View File

@ -669,7 +669,7 @@ static int handle_TCP_routing_req(TCP_Server *TCP_server, uint32_t con_id, const
other_conn->connections[other_id].status = 2;
other_conn->connections[other_id].index = con_id;
other_conn->connections[other_id].other_id = index;
//TODO: return values?
// TODO(irungentoo): return values?
send_connect_notification(con, index);
send_connect_notification(other_conn, other_id);
}
@ -728,7 +728,7 @@ static int rm_connection_index(TCP_Server *TCP_server, TCP_Secure_Connection *co
TCP_server->accepted_connection_array[index].connections[other_id].other_id = 0;
TCP_server->accepted_connection_array[index].connections[other_id].index = 0;
TCP_server->accepted_connection_array[index].connections[other_id].status = 1;
//TODO: return values?
// TODO(irungentoo): return values?
send_disconnect_notification(&TCP_server->accepted_connection_array[index], other_id);
}

View File

@ -196,7 +196,7 @@ static void dist_index_bubble(Assoc *assoc, uint64_t *dist_list, size_t first, s
}
}
/* TODO: Check that there isn't a function like this elsewhere hidden.
/* TODO(irungentoo): Check that there isn't a function like this elsewhere hidden.
* E.g. the one which creates a handshake_id isn't usable for this, it must
* always map the same ID to the same hash.
*

View File

@ -157,7 +157,7 @@ int decrypt_data(const uint8_t *public_key, const uint8_t *secret_key, const uin
/* Increment the given nonce by 1. */
void increment_nonce(uint8_t *nonce)
{
/* FIXME use increment_nonce_number(nonce, 1) or sodium_increment (change to little endian)
/* TODO(irungentoo): use increment_nonce_number(nonce, 1) or sodium_increment (change to little endian)
* NOTE don't use breaks inside this loop
* In particular, make sure, as far as possible,
* 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
uint8_t *nonce = packet + 1 + crypto_box_PUBLICKEYBYTES * 2;
new_nonce(nonce);
uint8_t temp[MAX_CRYPTO_REQUEST_SIZE]; // FIXME sodium_memzero before exit function
uint8_t temp[MAX_CRYPTO_REQUEST_SIZE]; // TODO(irungentoo): sodium_memzero before exit function
memcpy(temp + 1, data, length);
temp[0] = request_id;
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
memcpy(public_key, packet + 1 + crypto_box_PUBLICKEYBYTES, crypto_box_PUBLICKEYBYTES);
const uint8_t *nonce = packet + 1 + crypto_box_PUBLICKEYBYTES * 2;
uint8_t temp[MAX_CRYPTO_REQUEST_SIZE]; // FIXME sodium_memzero before exit function
uint8_t temp[MAX_CRYPTO_REQUEST_SIZE]; // TODO(irungentoo): sodium_memzero before exit function
int len1 = decrypt_data(public_key, self_secret_key, nonce,
packet + 1 + crypto_box_PUBLICKEYBYTES * 2 + crypto_box_NONCEBYTES,
length - (crypto_box_PUBLICKEYBYTES * 2 + crypto_box_NONCEBYTES + 1), temp);

View File

@ -37,7 +37,7 @@ typedef struct {
int (*filter_function)(const uint8_t *, void *);
void *filter_function_userdata;
/* NOTE: The following is just a temporary fix for the multiple friend requests received at the same time problem.
* TODO: Make this better (This will most likely tie in with the way we will handle spam.)
* TODO(irungentoo): Make this better (This will most likely tie in with the way we will handle spam.)
*/
#define MAX_RECEIVED_STORED 32

View File

@ -144,7 +144,7 @@ static Group_c *get_group_c(const Group_Chats *g_c, int groupnumber)
* return peer index if peer is in chat.
* return -1 if peer is not in chat.
*
* TODO: make this more efficient.
* TODO(irungentoo): make this more efficient.
*/
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)
* return group number if peer is in list.
* return -1 if group is not in list.
*
* TODO: make this more efficient and maybe use constant time comparisons?
* TODO(irungentoo): make this more efficient and maybe use constant time comparisons?
*/
static int get_group_num(const Group_Chats *g_c, const uint8_t *identifier)
{
@ -187,7 +187,7 @@ static int get_group_num(const Group_Chats *g_c, const uint8_t *identifier)
* return peer number if peer is in chat.
* return -1 if peer is not in chat.
*
* TODO: make this more efficient.
* TODO(irungentoo): make this more efficient.
*/
static int get_peer_index(Group_c *g, uint16_t peer_number)
{
@ -414,7 +414,7 @@ static int addpeer(Group_Chats *g_c, int groupnumber, const uint8_t *real_pk, co
return -1;
}
//TODO
// TODO(irungentoo):
int peer_index = peer_in_chat(g, real_pk);
if (peer_index != -1) {
@ -656,7 +656,7 @@ static int handle_status(void *object, int friendcon_id, uint8_t status, void *u
set_conns_status_groups(g_c, friendcon_id, GROUPCHAT_CLOSE_ONLINE);
} else { /* Went offline */
set_conns_status_groups(g_c, friendcon_id, GROUPCHAT_CLOSE_CONNECTION);
//TODO remove timedout connections?
// TODO(irungentoo): remove timedout connections?
}
return 0;
@ -703,7 +703,7 @@ static int add_conn_to_groupchat(Group_Chats *g_c, int friendcon_id, int groupnu
g->close[ind].type = GROUPCHAT_CLOSE_CONNECTION;
g->close[ind].number = friendcon_id;
g->close[ind].closest = closest;
//TODO
// TODO(irungentoo):
friend_connection_callbacks(g_c->m->fr_c, friendcon_id, GROUPCHAT_CALLBACK_INDEX, &handle_status, &handle_packet,
&handle_lossy, g_c, friendcon_id);
@ -1374,8 +1374,9 @@ static void handle_friend_invite_packet(Messenger *m, uint32_t friendnumber, con
return;
}
uint16_t peer_number = rand(); /* TODO: what if two people enter the group at the same time and
are given the same peer_number by different nodes? */
/* TODO(irungentoo): what if two people enter the group at the same time and
are given the same peer_number by different nodes? */
uint16_t peer_number = rand();
unsigned int tries = 0;
@ -1903,7 +1904,7 @@ int group_action_send(const Group_Chats *g_c, int groupnumber, const uint8_t *ac
*/
int send_group_lossy_packet(const Group_Chats *g_c, int groupnumber, const uint8_t *data, uint16_t length)
{
//TODO: length check here?
// TODO(irungentoo): length check here?
Group_c *g = get_group_c(g_c, groupnumber);
if (!g) {
@ -2004,7 +2005,7 @@ static void handle_message_packet_group(Group_Chats *g_c, int groupnumber, const
delpeer(g_c, groupnumber, index);
} else {
return;
//TODO
// TODO(irungentoo):
}
}
break;
@ -2032,7 +2033,7 @@ static void handle_message_packet_group(Group_Chats *g_c, int groupnumber, const
memcpy(newmsg, msg_data, msg_data_len);
newmsg[msg_data_len] = 0;
//TODO
// TODO(irungentoo):
if (g_c->message_callback) {
g_c->message_callback(g_c->m, groupnumber, index, newmsg, msg_data_len, g_c->message_callback_userdata);
}
@ -2049,7 +2050,7 @@ static void handle_message_packet_group(Group_Chats *g_c, int groupnumber, const
memcpy(newmsg, msg_data, msg_data_len);
newmsg[msg_data_len] = 0;
//TODO
// TODO(irungentoo):
if (g_c->action_callback) {
g_c->action_callback(g_c->m, groupnumber, index, newmsg, msg_data_len, g_c->action_callback_userdata);
}
@ -2061,7 +2062,7 @@ static void handle_message_packet_group(Group_Chats *g_c, int groupnumber, const
return;
}
send_message_all_close(g_c, groupnumber, data, length, -1/*TODO close_index*/);
send_message_all_close(g_c, groupnumber, data, length, -1/* TODO(irungentoo) close_index */);
}
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
* return 0 if packet was not received.
* return 1 if packet was received.
*
* TODO: test this
* TODO(irungentoo): test this
*/
static unsigned int lossy_packet_not_received(Group_c *g, int peer_index, uint16_t message_number)
{
@ -2416,7 +2417,7 @@ void do_groupchats(Group_Chats *g_c, void *userdata)
}
}
//TODO
// TODO(irungentoo):
}
/* Free everything related with group chats. */

View File

@ -505,7 +505,7 @@ static IP_Port return_ip_port_connection(Net_Crypto *c, int crypt_connection_id)
*/
static int send_packet_to(Net_Crypto *c, int crypt_connection_id, const uint8_t *data, uint16_t length)
{
//TODO TCP, etc...
// TODO(irungentoo): TCP, etc...
Crypto_Connection *conn = get_crypto_connection(c, crypt_connection_id);
if (conn == 0) {
@ -517,7 +517,7 @@ static int send_packet_to(Net_Crypto *c, int crypt_connection_id, const uint8_t
pthread_mutex_lock(&conn->mutex);
IP_Port ip_port = return_ip_port_connection(c, crypt_connection_id);
//TODO: on bad networks, direct connections might not last indefinitely.
// TODO(irungentoo): on bad networks, direct connections might not last indefinitely.
if (ip_port.ip.family != 0) {
bool direct_connected = 0;
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
return -1;
}
//TODO: a better way of sending packets directly to confirm the others ip.
// TODO(irungentoo): a better way of sending packets directly to confirm the others ip.
uint64_t current_time = unix_time();
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
return -1;
}
// else { /* TODO? */ }
// else { /* TODO(irungentoo): ? */ }
set_buffer_end(&conn->recv_array, num);
} 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)
}
}
while (1) { /* TODO: is this really the best way to do this? */
while (1) { /* TODO(irungentoo): is this really the best way to do this? */
pthread_mutex_lock(&c->connections_mutex);
if (!c->connection_use_counter) {
@ -1967,7 +1967,7 @@ static int tcp_data_callback(void *object, int id, const uint8_t *data, uint16_t
return -1;
}
//TODO detect and kill bad TCP connections.
// TODO(irungentoo): detect and kill bad TCP connections.
return 0;
}
@ -2034,7 +2034,7 @@ int add_tcp_relay(Net_Crypto *c, IP_Port ip_port, const uint8_t *public_key)
/* Return a random TCP connection number for use in send_tcp_onion_request.
*
* TODO: This number is just the index of an array that the elements can
* TODO(irungentoo): This number is just the index of an array that the elements can
* change without warning.
*
* return TCP connection number on success.
@ -2388,7 +2388,7 @@ static void send_crypto_packets(Net_Crypto *c)
} else {
long signed int total_sent = 0, total_resent = 0;
//TODO use real delay
// TODO(irungentoo): use real delay
unsigned int delay = (unsigned int)((conn->rtt_time / PACKET_COUNTER_AVERAGE_INTERVAL) + 0.5);
unsigned int packets_set_rem_array = (CONGESTION_LAST_SENT_ARRAY_SIZE - CONGESTION_QUEUE_ARRAY_SIZE);
@ -2424,7 +2424,7 @@ static void send_crypto_packets(Net_Crypto *c)
double send_array_ratio = (((double)npackets) / min_speed);
//TODO: Improve formula?
// TODO(irungentoo): Improve formula?
if (send_array_ratio > SEND_QUEUE_RATIO && CRYPTO_MIN_QUEUE_LENGTH < npackets) {
conn->packet_send_rate = min_speed * (1.0 / (send_array_ratio / SEND_QUEUE_RATIO));
} 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
*/
int crypto_kill(Net_Crypto *c, int crypt_connection_id)
{
while (1) { /* TODO: is this really the best way to do this? */
while (1) { /* TODO(irungentoo): is this really the best way to do this? */
pthread_mutex_lock(&c->connections_mutex);
if (!c->connection_use_counter) {
@ -2759,7 +2759,7 @@ void new_keys(Net_Crypto *c)
/* Save the public and private keys to the keys array.
* Length must be crypto_box_PUBLICKEYBYTES + crypto_box_SECRETKEYBYTES.
*
* TODO: Save only secret key.
* TODO(irungentoo): Save only secret key.
*/
void save_keys(const Net_Crypto *c, uint8_t *keys)
{
@ -2857,7 +2857,7 @@ static void kill_timedout(Net_Crypto *c, void *userdata)
#if 0
if (conn->status == CRYPTO_CONN_ESTABLISHED) {
//TODO: add a timeout here?
// TODO(irungentoo): add a timeout here?
}
#endif

View File

@ -494,14 +494,15 @@ int networking_at_startup(void)
return 0;
}
/* TODO: Put this somewhere
/* TODO(irungentoo): Put this somewhere */
#if 0
static void at_shutdown(void)
{
#if defined(_WIN32) || defined(__WIN32__) || defined (WIN32)
WSACleanup();
#endif
}
*/
#endif
/* Initialize networking.
* Added for reverse compatibility with old new_networking calls.
@ -873,7 +874,7 @@ void ipport_copy(IP_Port *target, const IP_Port *source)
* writes error message into the buffer on error
*/
/* there would be INET6_ADDRSTRLEN, but it might be too short for the error message */
static char addresstext[96]; // FIXME magic number. Why not INET6_ADDRSTRLEN ?
static char addresstext[96]; // TODO(irungentoo): magic number. Why not INET6_ADDRSTRLEN ?
const char *ip_ntoa(const IP *ip)
{
if (ip) {

View File

@ -203,7 +203,7 @@ static int is_path_used(const Onion_Client_Paths *onion_paths, const Node_format
continue;
}
// TODO: do we really have to check it with the last node?
// TODO(irungentoo): do we really have to check it with the last node?
if (ipport_equal(&onion_paths->paths[i].ip_port1, &nodes[ONION_PATH_LENGTH - 1].ip_port)) {
return i;
}
@ -228,8 +228,8 @@ static bool path_timed_out(Onion_Client_Paths *onion_paths, uint32_t pathnum)
* return -1 on failure
* return 0 on success
*
* TODO: Make this function better, it currently probably is vulnerable to some attacks that
* could de anonimize us.
* TODO(irungentoo): Make this function better, it currently probably is
* vulnerable to some attacks that could deanonimize us.
*/
static int random_path(const Onion_Client *onion_c, Onion_Client_Paths *onion_paths, uint32_t pathnum, Onion_Path *path)
{
@ -558,7 +558,7 @@ static int client_add_to_list(Onion_Client *onion_c, uint32_t num, const uint8_t
memcpy(list_nodes[index].public_key, public_key, crypto_box_PUBLICKEYBYTES);
list_nodes[index].ip_port = ip_port;
//TODO: remove this and find a better source of nodes to use for paths.
// TODO(irungentoo): remove this and find a better source of nodes to use for paths.
onion_add_path_node(onion_c, ip_port, public_key);
if (is_stored == 1) {
@ -718,7 +718,7 @@ static int handle_announce_response(void *object, IP_Port source, const uint8_t
}
}
//TODO: LAN vs non LAN ips?, if we are connected only to LAN, are we offline?
// TODO(irungentoo): LAN vs non LAN ips?, if we are connected only to LAN, are we offline?
onion_c->last_packet_recv = unix_time();
return 0;
}

View File

@ -250,7 +250,7 @@ Tox *tox_new(const struct Tox_Options *options, TOX_ERR_NEW *error)
if (!addr_resolve_or_parse_ip(options->proxy_host, &m_options.proxy_info.ip_port.ip, NULL)) {
SET_ERROR_PARAMETER(error, TOX_ERR_NEW_PROXY_BAD_HOST);
//TODO: TOX_ERR_NEW_PROXY_NOT_FOUND if domain.
// TODO(irungentoo): TOX_ERR_NEW_PROXY_NOT_FOUND if domain.
return NULL;
}
@ -527,7 +527,7 @@ bool tox_self_set_name(Tox *tox, const uint8_t *name, size_t length, TOX_ERR_SET
Messenger *m = tox;
if (setname(m, name, length) == 0) {
//TODO: function to set different per group names?
// TODO(irungentoo): function to set different per group names?
send_name_all_groups(m->group_chat_object);
SET_ERROR_PARAMETER(error, TOX_ERR_SET_INFO_OK);
return 1;
@ -672,7 +672,7 @@ bool tox_friend_delete(Tox *tox, uint32_t friend_number, TOX_ERR_FRIEND_DELETE *
Messenger *m = tox;
int ret = m_delfriend(m, friend_number);
//TODO handle if realloc fails?
// TODO(irungentoo): handle if realloc fails?
if (ret == -1) {
SET_ERROR_PARAMETER(error, TOX_ERR_FRIEND_DELETE_FRIEND_NOT_FOUND);
return 0;
@ -749,7 +749,7 @@ void tox_self_get_friend_list(const Tox *tox, uint32_t *friend_list)
{
if (friend_list) {
const Messenger *m = tox;
//TODO: size parameter?
// TODO(irungentoo): size parameter?
copy_friendlist(m, friend_list, tox_self_get_friend_list_size(tox));
}
}
@ -816,7 +816,7 @@ bool tox_friend_get_status_message(const Tox *tox, uint32_t friend_number, uint8
}
const Messenger *m = tox;
//TODO: size parameter?
// TODO(irungentoo): size parameter?
int ret = m_copy_statusmessage(m, friend_number, status_message, m_get_statusmessage_size(m, friend_number));
if (ret == -1) {

View File

@ -282,7 +282,7 @@ uint32_t tox_max_friend_request_length(void);
uint32_t tox_max_message_length(void);
/**
* Maximum size of custom packets. TODO: should be LENGTH?
* Maximum size of custom packets. TODO(iphydf): should be LENGTH?
*/
#define TOX_MAX_CUSTOM_PACKET_SIZE 1373
@ -928,7 +928,7 @@ typedef void tox_self_connection_status_cb(Tox *tox, TOX_CONNECTION connection_s
* amounts of time. Clients should therefore not immediately bootstrap on
* receiving a disconnect.
*
* TODO: how long should a client wait before bootstrapping again?
* TODO(iphydf): how long should a client wait before bootstrapping again?
*/
void tox_callback_self_connection_status(Tox *tox, tox_self_connection_status_cb *callback);

View File

@ -147,7 +147,7 @@ int tox_generate_dns3_string(void *dns3_object, uint8_t *string, uint16_t string
}
if (end_len != string - old_str) {
// FIXME: This currently has no access to a logger.
// TODO(iphydf): This currently has no access to a logger.
LOGGER_ERROR(NULL, "tox_generate_dns3_string Fail, %u != %lu\n", end_len, string - old_str);
return -1;
}