Commit Graph

214 Commits

Author SHA1 Message Date
irungentoo
62f8910fb7
Fixed memory leak. 2015-02-06 19:18:40 -05:00
irungentoo
57c22b1acb Fix memory leaks. 2015-02-06 19:10:16 -05:00
irungentoo
33f65929e3
Fixed bug where mutex would be destroyed but not recreated for new
net_crypto connection.

Only destroy mutex when it is realloced out.
2015-01-31 13:28:22 -05:00
irungentoo
f463cb52a2
Code cleanups.
Rename array in Node_format from client_id to public_key.
2015-01-29 19:38:44 -05:00
irungentoo
6e0b807f09
Attempted fix of Tox disconnecting during file transfers by tweaking
some congestion control numbers.
2015-01-17 21:27:38 -05:00
irungentoo
0fff7d9994
Tox should work better on TCP only when some people have broken TCP
nodes and don't update them.

Paths now try to use the same TCP node for their entire lifetime.
2015-01-16 21:33:11 -05:00
irungentoo
c2e394c5c2
Fixed bug with auto tests and cleaned up the code a bit. 2014-12-26 20:12:51 -05:00
irungentoo
fe57a72659
Merge branch 'http-proxy-feature' of https://github.com/nurupo/InsertProjectNameHere 2014-12-26 19:38:19 -05:00
Maxim Biro
e9bf38499e Some refactoring of proxy code 2014-12-21 19:59:00 -05:00
irungentoo
f9f236248d
Some optimizations on how TCP relays are used. 2014-12-15 15:21:39 -05:00
irungentoo
d7f5713277
Fixed crash when connection was killed during the packet callback. 2014-12-11 13:54:55 -05:00
irungentoo
475c157d68
Fixed possible threading issue. 2014-12-03 14:22:41 -05:00
irungentoo
4a27f61956
Fixed possible threading issue. 2014-12-03 14:02:43 -05:00
irungentoo
d8a8e8b982
Fixed possible threading issues. 2014-12-03 13:58:50 -05:00
irungentoo
8deb032b2d
Merge branch 'mutex-1' of https://github.com/mannol/toxcore 2014-11-29 16:09:24 -05:00
mannol
e62ded3a6d More av cleanup 2014-11-29 13:42:19 +01:00
irungentoo
a7a225d1d6
Fixed threading issues in toxcore. 2014-11-25 17:23:26 -05:00
irungentoo
6bbb939855
Cleaned up packet length types in toxcore.
They are now all uint16_t instead of sometimes being uint32_t.

Replaced some other uint32_t with unsigned ints.
2014-11-21 20:18:29 -05:00
irungentoo
9cd1102f4a
Fixed some threading related issues in toxcore. 2014-11-14 11:03:05 -05:00
irungentoo
ab42c91a49
Prevent connection ips from switching on LAN. 2014-11-11 08:03:11 -05:00
irungentoo_trip
b877d1dc1c Merge branch 'master' of https://github.com/xor2003/toxcore
#
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
2014-10-25 08:51:43 -07:00
xor2003
2aed4bb75e Add a check (reported by Coverity) 2014-10-24 16:04:55 +04:00
xor2003
69c9f68573 Prevent lock 2014-10-24 16:01:58 +04:00
xor2003
6b0fe7eb41 Fix uninitialized 2014-10-24 15:57:10 +04:00
irungentoo
03d6f95713
Remove timestamp from set_connection_dht_public_key(). 2014-09-26 21:22:07 -04:00
irungentoo
33e5c34aaf
Only set dht public key and direct ip when first creating connection.
Check if ip family is valid in set_direct_ip_port() function.
2014-09-26 21:14:36 -04:00
irungentoo
c618263acd
Removed useless code from onion_client.
Astyled.
2014-09-26 20:43:59 -04:00
irungentoo
f2a313359e
Added callbacks to onion_client and net_crypto for the temp dht key.
Better than the polling mess.

Moved DHT to Messenger from onion_client (still needs some cleanups).
2014-09-26 20:32:38 -04:00
irungentoo
744f51ec36
Added some checks to mutex related functions. 2014-09-23 21:00:12 -04:00
Tux3 / Mlkj / !Lev.uXFMLA
4b2aed74ec Replace fprintf(stderr,...) by LOGGER_*() in net_crypto 2014-09-11 17:04:37 +02:00
cgar
2bb2bc4163 spelling corrections 2014-09-09 20:31:37 -04:00
irungentoo
fa007a3b04
Speeded up start of file transfers. 2014-08-29 21:44:00 -04:00
irungentoo
0f023d912c
Removed useless code. 2014-08-29 21:39:14 -04:00
irungentoo
69725e8e74
Lossless crypto packets can now be sent without the congestion control applying to them. 2014-08-29 21:32:05 -04:00
irungentoo
33b4268f7e
Added function to check if packet sent with net_crypto was received. 2014-08-27 14:37:28 -04:00
irungentoo
0fe6d84768
Removed useless line. 2014-08-16 22:21:47 -04:00
irungentoo
9134048bb5
Some thread safety related fixes to TCP connections in net_crypto.
Added a recursive mutex to fix possible thread issues when the A/V
thread sends data at the same time as the main thread.
2014-08-16 22:09:29 -04:00
irungentoo
162a900660
New congestion control algorithm.
This new congestion control algorithm uses the increase in size
of the send queue to regulate how fast it sends data.

When tweaked it should work better than the old one.
2014-08-16 18:14:47 -04:00
irungentoo
cb815f7584
When getting disconnected from good relay, try to reconnect. 2014-08-14 17:29:50 -04:00
irungentoo
78dd2234e0
Added basic socks5 proxy support to TCP client. 2014-08-14 14:31:26 -04:00
irungentoo
e6f21d0524
Added functions to receive and send onion packets via TCP to net_crypto.c 2014-08-11 20:47:56 -04:00
irungentoo
946a09f57b
Adding a new connection while a lossy packet is being sent could
also cause thread related issues.
2014-07-31 13:11:21 -04:00
irungentoo
d270cf550a
Fixed possible threading issues.
send_lossy_cryptpacket() can get called from another thread meaning
the connection can be killed while the packet is sending.
2014-07-31 12:46:36 -04:00
irungentoo
df6e6dfd6b
Spreading packets around TCP relays causes issues with the audio and video.
Make each connection stick to the same relay.
2014-07-29 09:08:23 -04:00
irungentoo
6dcd90a116
Only send kill packet when killing established connection. 2014-07-27 10:22:29 -04:00
irungentoo
fdb5d890a3
Fixed bug where two Tox clients sometimes didn't reconnect right
after disconnecting due to them getting stuck in a connection loop.
2014-07-21 13:29:36 -04:00
irungentoo
8d15ccc347
Don't set connection to established if packet is kill packet.
Removed now useless defines in network.h
2014-07-21 12:58:28 -04:00
irungentoo
8195ade709
Removed useless function. 2014-07-19 22:09:30 -04:00
irungentoo
9c84b5401c
Spread packets over many TCP relays instead of just using the first one. 2014-07-18 21:34:22 -04:00
irungentoo
32ed095d72
Change connection status before handling data packets. 2014-07-14 18:20:17 -04:00
irungentoo
2ea634ece2
Set packets_left to default non zero values when creating connection. 2014-07-14 16:37:43 -04:00
irungentoo
4da8664a15
Packets can now be sent from the connection status callback. 2014-07-14 16:23:19 -04:00
irungentoo
0244bd596d
Attempted fix of file transfer issue.
Instead of dropping the rate to minimum just half it until it drops
to the minimum.
2014-07-14 12:21:13 -04:00
notsecure
a5d2775c25 . 2014-07-11 10:23:40 -04:00
notsecure
e2d388b137 fix send rate going up when peer disconnects 2014-07-10 10:34:38 -04:00
irungentoo
6d4fdb3597
Merge branch 'const_correctness' of https://github.com/schuetzm/ProjectTox-Core 2014-07-02 15:41:59 -04:00
Marc Schütz
aba594d1f8 Const-correctness for toxcore/net_crypto.c 2014-06-30 21:26:51 +02:00
Marc Schütz
8391417f61 Const correctness for toxcore/Messenger.c and related files 2014-06-30 21:26:50 +02:00
irungentoo
8f7638da5c
Core should no longer attempt to send data faster than the links can
carry it.
2014-06-29 20:46:06 -04:00
irungentoo
a058a17273
Fixed some more possible issues with file transfers/conjestion control. 2014-06-25 15:04:34 -04:00
irungentoo
eb2688b715
Tweaked conjestion control algorithm.
File transfers should now work better.
2014-06-25 13:23:56 -04:00
Maxim Biro
a32d270330 Reduced number of realloc calls bs_list does 2014-06-20 20:22:03 -04:00
irungentoo
750c75a47d
Astyled code. 2014-06-15 10:36:57 -04:00
Marc Schütz
4940c4c62b Const correctness for various packet callbacks 2014-06-13 22:55:15 +02:00
irungentoo
2740099da0
pthread is now a core dependency instead of just a toxav dependency.
Fixed possible thread bug with sending A/V packets.

TODO: eventually make toxcore thread safe.
2014-06-12 11:15:20 -04:00
Marc Schütz
99d5940140 Const correctness in various interdependent files 2014-06-10 20:54:48 +02:00
irungentoo
7adefb6e6b
Renamed list functions to fix conflict issue on certain machines. 2014-06-06 13:23:21 -04:00
irungentoo
a4ac1497a5
Fixed regression that made packet_send_rate increase even when
no data was transmitted.
2014-06-05 19:16:03 -04:00
irungentoo
94a675f3e9
Optimized net_crypto UDP packet sorting using list. 2014-06-05 18:05:17 -04:00
irungentoo
aa256d5858
Doubled minimum transfer rate.
File transfers got stuck because it was too low.
2014-06-04 17:55:07 -04:00
irungentoo
dc6f46a240
Request packets are now sent with send_data_packet_helper().
This means all data packets are now padded the same way.
2014-06-04 17:35:38 -04:00
irungentoo
b44b58cae4
Added data packet padding to toxcore.
Data sent as lossless or lossy is now padded with:
((MAX_CRYPTO_DATA_SIZE - data_length) % CRYPTO_MAX_PADDING) bytes
in order to reduce the possibility of length related attacks.

I set CRYPTO_MAX_PADDING to 8 but it can be changed anytime without
breaking network compatibility between tox cores.
2014-06-04 13:28:56 -04:00
irungentoo
de5a33e852
Tweaked file transfers a bit. 2014-06-03 20:17:31 -04:00
irungentoo
4eecaf3ee6
Increased some timeouts to try to prevent disconnections when
transferring files on wireless networks.
2014-06-02 19:35:49 -04:00
irungentoo
89bf08287d
Renamed tox_do_run_interval to tox_do_interval.
tox_do_interval now returns a time in ms based on how much action
is going on in net_crypto.
2014-05-30 23:01:17 -04:00
notsecure
5346af8067 file transfer fixes
-removed rate limit
-send rate no longer gets reset on local/LAN connections
2014-05-26 13:33:19 -04:00
notsecure
e3bc591b3b more conjestion control
needs testing
2014-05-22 20:19:19 -04:00
notsecure
1e4eb83880 improved conjestion control 2014-05-21 20:49:37 -04:00
irungentoo
f818c1a197
Added functions to send and receive lossy encrypted packets over
the Tox connection.

A/V should now work over TCP.
2014-05-21 15:28:14 -04:00
irungentoo
d68197b895
Save a couple TCP relays on save and reconnect to them on load.
Removed some old code.
2014-05-18 13:45:33 -04:00
irungentoo
d573271f03
Fixed connection issue. 2014-05-18 12:15:57 -04:00
irungentoo
e87929e869
TCP branch now ready for start of real testing.
Friends can now exchange TCP relay addresses so that they can
connect together.

Currently all bootstrap nodes are treated as TCP relays.
2014-05-18 10:55:38 -04:00
irungentoo
9d4947ffa5
add_tcp_relay_peer() can be used to add relays that we know that
peer is connected to.

Some cleanups/fixes.
2014-05-17 21:30:52 -04:00
irungentoo
b5f84b33f7
net_crypto now works again on pure UDP. 2014-05-17 15:23:16 -04:00
irungentoo
60ed415a5a
Added a function to get the DHT public key stored in net_crypto.
The DHT public keys in onion_client/net_crypto are synced and set
to whichever is more recent.

Tox peers now try to connect directly even when already connected
with a TCP relay.
2014-05-17 14:56:20 -04:00
irungentoo
a5da6df144
Net_crypto can now handle packets sent as TCP OOB packets.
Added timestamp to know which DHT public key is good in case
onion_client and net_crypto report different ones.
2014-05-17 12:33:22 -04:00
irungentoo
454cadb91c
Changed cookie/cookie request packet.
Cookie now contains the dht public key of the peer which makes
more sense than including the real public key of the reciever.

It means we no longer have to rely entirely on onion_client to
find the dht public key of the other peer.
2014-05-17 09:21:07 -04:00
irungentoo
86c191c2d4
Fixed typo. 2014-05-16 17:50:26 -04:00
irungentoo
3ab05b6e2e
Some TCP code added to net_crypto.
add_tcp_relay() can be used to connect to some TCP relays.

If both Toxes are connected to the same TCP relay(s) and create a
connection on which they set the others dht_public_key, they will
connect.
2014-05-16 17:29:50 -04:00
irungentoo
1e7164fcee
Fixed possibility that packet_send_rate would get stuck. 2014-05-15 16:49:39 -04:00
irungentoo
2ea0657a6d
Fixed some issues.
Friends with multiple ips (on LAN) should be handled better.

Remade the function to check the crypto connection status.
2014-05-12 20:59:51 -04:00
irungentoo
87cec79206
Fixed issue where callbacks were not set for accepted connection. 2014-05-11 19:35:23 -04:00
irungentoo
1580a5c696
Added kill packets.
There should be no more delay between a peer closing their client
and their friend being notified of them going offline. (unless the
kill packet is lost)
2014-05-11 18:27:23 -04:00
irungentoo
1e485b2c2f
Added basic congestion control to net_crypto. 2014-05-10 13:42:59 -04:00
irungentoo
b0731f54cd
Fixed small issues.
Added set_buffer_end().

File transfer test now checks if pieces arrive correctly.
2014-05-09 21:46:37 -04:00
irungentoo
98f20c76de
Connection between toxes is lossless once again. 2014-05-08 18:04:46 -04:00
irungentoo
32c8d5114c
Fixed bug. 2014-05-05 10:00:37 -04:00
irungentoo
fca5e1b99a
Added arrays to store packets on send/recv in net crypto.
Wrote down more of the protocol.

Padding support has been added and implemented which will make it
possible for us to pad packets to mitigate length related attacks.
2014-05-04 20:04:43 -04:00
irungentoo
4dc0af61c6
All time in core is now monotonic. 2014-05-03 11:58:45 -04:00
irungentoo
db78c99ff4
Messenger now works with the new net_crypto api.
Added callbacks in net_crypto for the data packets and status changes.

Added onion_getfriend_DHT_pubkey to onion_client.

Net crypto isn't done yet so connections between toxes are not
lossless, this means file sending is broken hence why the test fails.
2014-05-02 21:25:23 -04:00