summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--toxav/toxav.c8
-rw-r--r--toxav/video.c8
-rw-r--r--toxcore/DHT.c6
-rw-r--r--toxcore/DHT.h6
-rw-r--r--toxcore/LAN_discovery.c2
-rw-r--r--toxcore/Messenger.c2
-rw-r--r--toxcore/TCP_connection.h2
-rw-r--r--toxcore/friend_connection.c2
-rw-r--r--toxcore/net_crypto.c8
-rw-r--r--toxcore/net_crypto.h4
-rw-r--r--toxcore/onion_client.c4
-rw-r--r--toxcore/onion_client.h2
12 files changed, 27 insertions, 27 deletions
diff --git a/toxav/toxav.c b/toxav/toxav.c
index 0ecf8259..2e2e8b07 100644
--- a/toxav/toxav.c
+++ b/toxav/toxav.c
@@ -30,10 +30,10 @@
30#define VIDEO_SEND_X_KEYFRAMES_FIRST 7 // force the first n frames to be keyframes! 30#define VIDEO_SEND_X_KEYFRAMES_FIRST 7 // force the first n frames to be keyframes!
31 31
32/* 32/*
33VPX_DL_REALTIME (1) deadline parameter analogous to VPx REALTIME mode. 33 * VPX_DL_REALTIME (1) deadline parameter analogous to VPx REALTIME mode.
34VPX_DL_GOOD_QUALITY (1000000) deadline parameter analogous to VPx GOOD QUALITY mode. 34 * VPX_DL_GOOD_QUALITY (1000000) deadline parameter analogous to VPx GOOD QUALITY mode.
35VPX_DL_BEST_QUALITY (0) deadline parameter analogous to VPx BEST QUALITY mode. 35 * VPX_DL_BEST_QUALITY (0) deadline parameter analogous to VPx BEST QUALITY mode.
36*/ 36 */
37 37
38typedef struct ToxAVCall_s { 38typedef struct ToxAVCall_s {
39 ToxAV *av; 39 ToxAV *av;
diff --git a/toxav/video.c b/toxav/video.c
index 3d3714eb..56be17ab 100644
--- a/toxav/video.c
+++ b/toxav/video.c
@@ -237,10 +237,10 @@ VCSession *vc_new(Mono_Time *mono_time, const Logger *log, ToxAV *av, uint32_t f
237 } 237 }
238 238
239 /* 239 /*
240 VPX_CTRL_USE_TYPE(VP8E_SET_NOISE_SENSITIVITY, unsigned int) 240 * VPX_CTRL_USE_TYPE(VP8E_SET_NOISE_SENSITIVITY, unsigned int)
241 control function to set noise sensitivity 241 * control function to set noise sensitivity
242 0: off, 1: OnYOnly, 2: OnYUV, 3: OnYUVAggressive, 4: Adaptive 242 * 0: off, 1: OnYOnly, 2: OnYUV, 3: OnYUVAggressive, 4: Adaptive
243 */ 243 */
244#if 0 244#if 0
245 rc = vpx_codec_control(vc->encoder, VP8E_SET_NOISE_SENSITIVITY, 2); 245 rc = vpx_codec_control(vc->encoder, VP8E_SET_NOISE_SENSITIVITY, 2);
246 246
diff --git a/toxcore/DHT.c b/toxcore/DHT.c
index 15f554e2..75a485b7 100644
--- a/toxcore/DHT.c
+++ b/toxcore/DHT.c
@@ -1294,7 +1294,7 @@ static void returnedip_ports(DHT *dht, IP_Port ip_port, const uint8_t *public_ke
1294} 1294}
1295 1295
1296/* Send a getnodes request. 1296/* Send a getnodes request.
1297 sendback_node is the node that it will send back the response to (set to NULL to disable this) */ 1297 * sendback_node is the node that it will send back the response to (set to NULL to disable this) */
1298static int getnodes(DHT *dht, IP_Port ip_port, const uint8_t *public_key, const uint8_t *client_id, 1298static int getnodes(DHT *dht, IP_Port ip_port, const uint8_t *public_key, const uint8_t *client_id,
1299 const Node_format *sendback_node) 1299 const Node_format *sendback_node)
1300{ 1300{
@@ -1427,7 +1427,7 @@ static int handle_getnodes(void *object, IP_Port source, const uint8_t *packet,
1427} 1427}
1428 1428
1429/* return false if no 1429/* return false if no
1430 return true if yes */ 1430 * return true if yes */
1431static bool sent_getnode_to_node(DHT *dht, const uint8_t *public_key, IP_Port node_ip_port, uint64_t ping_id, 1431static bool sent_getnode_to_node(DHT *dht, const uint8_t *public_key, IP_Port node_ip_port, uint64_t ping_id,
1432 Node_format *sendback_node) 1432 Node_format *sendback_node)
1433{ 1433{
@@ -2447,7 +2447,7 @@ static int handle_hardening(void *object, IP_Port source, const uint8_t *source_
2447 length_nodes, 0); 2447 length_nodes, 0);
2448 2448
2449 /* TODO(irungentoo): MAX_SENT_NODES nodes should be returned at all times 2449 /* TODO(irungentoo): MAX_SENT_NODES nodes should be returned at all times
2450 (right now we have a small network size so it could cause problems for testing and etc..) */ 2450 * (right now we have a small network size so it could cause problems for testing and etc..) */
2451 if (num_nodes <= 0) { 2451 if (num_nodes <= 0) {
2452 return 1; 2452 return 1;
2453 } 2453 }
diff --git a/toxcore/DHT.h b/toxcore/DHT.h
index 13f7ce20..40ce73f1 100644
--- a/toxcore/DHT.h
+++ b/toxcore/DHT.h
@@ -69,9 +69,9 @@ int create_request(const uint8_t *send_public_key, const uint8_t *send_secret_ke
69 const uint8_t *recv_public_key, const uint8_t *data, uint32_t length, uint8_t request_id); 69 const uint8_t *recv_public_key, const uint8_t *data, uint32_t length, uint8_t request_id);
70 70
71/* puts the senders public key in the request in public_key, the data from the request 71/* puts the senders public key in the request in public_key, the data from the request
72 in data if a friend or ping request was sent to us and returns the length of the data. 72 * in data if a friend or ping request was sent to us and returns the length of the data.
73 packet is the request packet and length is its length 73 * packet is the request packet and length is its length
74 return -1 if not valid request. */ 74 * return -1 if not valid request. */
75int handle_request(const uint8_t *self_public_key, const uint8_t *self_secret_key, uint8_t *public_key, uint8_t *data, 75int handle_request(const uint8_t *self_public_key, const uint8_t *self_secret_key, uint8_t *public_key, uint8_t *data,
76 uint8_t *request_id, const uint8_t *packet, uint16_t length); 76 uint8_t *request_id, const uint8_t *packet, uint16_t length);
77 77
diff --git a/toxcore/LAN_discovery.c b/toxcore/LAN_discovery.c
index e23550df..3f6951fc 100644
--- a/toxcore/LAN_discovery.c
+++ b/toxcore/LAN_discovery.c
@@ -331,7 +331,7 @@ bool ip_is_lan(IP ip)
331 331
332 if (net_family_is_ipv6(ip.family)) { 332 if (net_family_is_ipv6(ip.family)) {
333 /* autogenerated for each interface: `FE80::*` (up to `FEBF::*`) 333 /* autogenerated for each interface: `FE80::*` (up to `FEBF::*`)
334 `FF02::1` is - according to RFC 4291 - multicast all-nodes link-local */ 334 * `FF02::1` is - according to RFC 4291 - multicast all-nodes link-local */
335 if (((ip.ip.v6.uint8[0] == 0xFF) && (ip.ip.v6.uint8[1] < 3) && (ip.ip.v6.uint8[15] == 1)) || 335 if (((ip.ip.v6.uint8[0] == 0xFF) && (ip.ip.v6.uint8[1] < 3) && (ip.ip.v6.uint8[15] == 1)) ||
336 ((ip.ip.v6.uint8[0] == 0xFE) && ((ip.ip.v6.uint8[1] & 0xC0) == 0x80))) { 336 ((ip.ip.v6.uint8[0] == 0xFE) && ((ip.ip.v6.uint8[1] & 0xC0) == 0x80))) {
337 return true; 337 return true;
diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c
index 9984d7f0..9d84e7a7 100644
--- a/toxcore/Messenger.c
+++ b/toxcore/Messenger.c
@@ -2510,7 +2510,7 @@ static char *id_to_string(const uint8_t *pk, char *id_str, size_t length)
2510} 2510}
2511 2511
2512/* Minimum messenger run interval in ms 2512/* Minimum messenger run interval in ms
2513 TODO(mannol): A/V */ 2513 * TODO(mannol): A/V */
2514#define MIN_RUN_INTERVAL 50 2514#define MIN_RUN_INTERVAL 50
2515 2515
2516/* Return the time in milliseconds before do_messenger() should be called again 2516/* Return the time in milliseconds before do_messenger() should be called again
diff --git a/toxcore/TCP_connection.h b/toxcore/TCP_connection.h
index 1bd5b85a..f5dd36f4 100644
--- a/toxcore/TCP_connection.h
+++ b/toxcore/TCP_connection.h
@@ -30,7 +30,7 @@
30#define TCP_CONNECTION_ANNOUNCE_TIMEOUT (TCP_CONNECTION_TIMEOUT) 30#define TCP_CONNECTION_ANNOUNCE_TIMEOUT (TCP_CONNECTION_TIMEOUT)
31 31
32/* The amount of recommended connections for each friend 32/* The amount of recommended connections for each friend
33 NOTE: Must be at most (MAX_FRIEND_TCP_CONNECTIONS / 2) */ 33 * NOTE: Must be at most (MAX_FRIEND_TCP_CONNECTIONS / 2) */
34#define RECOMMENDED_FRIEND_TCP_CONNECTIONS (MAX_FRIEND_TCP_CONNECTIONS / 2) 34#define RECOMMENDED_FRIEND_TCP_CONNECTIONS (MAX_FRIEND_TCP_CONNECTIONS / 2)
35 35
36/* Number of TCP connections used for onion purposes. */ 36/* Number of TCP connections used for onion purposes. */
diff --git a/toxcore/friend_connection.c b/toxcore/friend_connection.c
index fd1fa71c..496b83b5 100644
--- a/toxcore/friend_connection.c
+++ b/toxcore/friend_connection.c
@@ -273,7 +273,7 @@ static unsigned int send_relays(Friend_Connections *fr_c, int friendcon_id)
273 273
274 for (int i = 0; i < n; ++i) { 274 for (int i = 0; i < n; ++i) {
275 /* Associated the relays being sent with this connection. 275 /* Associated the relays being sent with this connection.
276 On receiving the peer will do the same which will establish the connection. */ 276 * On receiving the peer will do the same which will establish the connection. */
277 friend_add_tcp_relay(fr_c, friendcon_id, nodes[i].ip_port, nodes[i].public_key); 277 friend_add_tcp_relay(fr_c, friendcon_id, nodes[i].ip_port, nodes[i].public_key);
278 } 278 }
279 279
diff --git a/toxcore/net_crypto.c b/toxcore/net_crypto.c
index 43cc8ab1..b1473632 100644
--- a/toxcore/net_crypto.c
+++ b/toxcore/net_crypto.c
@@ -1119,7 +1119,7 @@ static int reset_max_speed_reached(Net_Crypto *c, int crypt_connection_id)
1119 } 1119 }
1120 1120
1121 /* If last packet send failed, try to send packet again. 1121 /* If last packet send failed, try to send packet again.
1122 If sending it fails we won't be able to send the new packet. */ 1122 * If sending it fails we won't be able to send the new packet. */
1123 if (conn->maximum_speed_reached) { 1123 if (conn->maximum_speed_reached) {
1124 Packet_Data *dt = nullptr; 1124 Packet_Data *dt = nullptr;
1125 const uint32_t packet_num = conn->send_array.buffer_end - 1; 1125 const uint32_t packet_num = conn->send_array.buffer_end - 1;
@@ -1157,7 +1157,7 @@ static int64_t send_lossless_packet(Net_Crypto *c, int crypt_connection_id, cons
1157 } 1157 }
1158 1158
1159 /* If last packet send failed, try to send packet again. 1159 /* If last packet send failed, try to send packet again.
1160 If sending it fails we won't be able to send the new packet. */ 1160 * If sending it fails we won't be able to send the new packet. */
1161 reset_max_speed_reached(c, crypt_connection_id); 1161 reset_max_speed_reached(c, crypt_connection_id);
1162 1162
1163 if (conn->maximum_speed_reached && congestion_control) { 1163 if (conn->maximum_speed_reached && congestion_control) {
@@ -2480,7 +2480,7 @@ static int udp_handle_packet(void *object, IP_Port source, const uint8_t *packet
2480} 2480}
2481 2481
2482/* The dT for the average packet receiving rate calculations. 2482/* The dT for the average packet receiving rate calculations.
2483 Also used as the */ 2483 * Also used as the */
2484#define PACKET_COUNTER_AVERAGE_INTERVAL 50 2484#define PACKET_COUNTER_AVERAGE_INTERVAL 50
2485 2485
2486/* Ratio of recv queue size / recv packet rate (in seconds) times 2486/* Ratio of recv queue size / recv packet rate (in seconds) times
@@ -2566,7 +2566,7 @@ static void send_crypto_packets(Net_Crypto *c)
2566 conn->packets_resent = 0; 2566 conn->packets_resent = 0;
2567 2567
2568 /* conjestion control 2568 /* conjestion control
2569 calculate a new value of conn->packet_send_rate based on some data 2569 * calculate a new value of conn->packet_send_rate based on some data
2570 */ 2570 */
2571 2571
2572 unsigned int pos = conn->last_sendqueue_counter % CONGESTION_QUEUE_ARRAY_SIZE; 2572 unsigned int pos = conn->last_sendqueue_counter % CONGESTION_QUEUE_ARRAY_SIZE;
diff --git a/toxcore/net_crypto.h b/toxcore/net_crypto.h
index 3885a1ba..33275708 100644
--- a/toxcore/net_crypto.h
+++ b/toxcore/net_crypto.h
@@ -87,7 +87,7 @@
87#define CRYPTO_SEND_PACKET_INTERVAL 1000 87#define CRYPTO_SEND_PACKET_INTERVAL 1000
88 88
89/* The maximum number of times we try to send the cookie request and handshake 89/* The maximum number of times we try to send the cookie request and handshake
90 before giving up. */ 90 * before giving up. */
91#define MAX_NUM_SENDPACKET_TRIES 8 91#define MAX_NUM_SENDPACKET_TRIES 8
92 92
93/* The timeout of no received UDP packets before the direct UDP connection is considered dead. */ 93/* The timeout of no received UDP packets before the direct UDP connection is considered dead. */
@@ -100,7 +100,7 @@
100#define CRYPTO_MAX_PADDING 8 100#define CRYPTO_MAX_PADDING 8
101 101
102/* Base current transfer speed on last CONGESTION_QUEUE_ARRAY_SIZE number of points taken 102/* Base current transfer speed on last CONGESTION_QUEUE_ARRAY_SIZE number of points taken
103 at the dT defined in net_crypto.c */ 103 * at the dT defined in net_crypto.c */
104#define CONGESTION_QUEUE_ARRAY_SIZE 12 104#define CONGESTION_QUEUE_ARRAY_SIZE 12
105#define CONGESTION_LAST_SENT_ARRAY_SIZE (CONGESTION_QUEUE_ARRAY_SIZE * 2) 105#define CONGESTION_LAST_SENT_ARRAY_SIZE (CONGESTION_QUEUE_ARRAY_SIZE * 2)
106 106
diff --git a/toxcore/onion_client.c b/toxcore/onion_client.c
index c1b2dcf7..bd40de13 100644
--- a/toxcore/onion_client.c
+++ b/toxcore/onion_client.c
@@ -21,7 +21,7 @@
21#include "util.h" 21#include "util.h"
22 22
23/* defines for the array size and 23/* defines for the array size and
24 timeout for onion announce packets. */ 24 * timeout for onion announce packets. */
25#define ANNOUNCE_ARRAY_SIZE 256 25#define ANNOUNCE_ARRAY_SIZE 256
26#define ANNOUNCE_TIMEOUT 10 26#define ANNOUNCE_TIMEOUT 10
27 27
@@ -1782,7 +1782,7 @@ static int onion_isconnected(const Onion_Client *onion_c)
1782 } 1782 }
1783 1783
1784 /* Consider ourselves online if we are announced to half or more nodes 1784 /* Consider ourselves online if we are announced to half or more nodes
1785 we are connected to */ 1785 * we are connected to */
1786 if (num && announced) { 1786 if (num && announced) {
1787 if ((num / 2) <= announced && (pnodes / 2) <= num) { 1787 if ((num / 2) <= announced && (pnodes / 2) <= num) {
1788 return 1; 1788 return 1;
diff --git a/toxcore/onion_client.h b/toxcore/onion_client.h
index 88e97dd6..c0f8f52c 100644
--- a/toxcore/onion_client.h
+++ b/toxcore/onion_client.h
@@ -26,7 +26,7 @@
26#define NUMBER_ONION_PATHS 6 26#define NUMBER_ONION_PATHS 6
27 27
28/* The timeout the first time the path is added and 28/* The timeout the first time the path is added and
29 then for all the next consecutive times */ 29 * then for all the next consecutive times */
30#define ONION_PATH_FIRST_TIMEOUT 4 30#define ONION_PATH_FIRST_TIMEOUT 4
31#define ONION_PATH_TIMEOUT 10 31#define ONION_PATH_TIMEOUT 10
32#define ONION_PATH_MAX_LIFETIME 1200 32#define ONION_PATH_MAX_LIFETIME 1200