Commit Graph

2254 Commits

Author SHA1 Message Date
Maxim Biro
8b5e3d5208 Allow multiple instances of the daemon 2014-05-18 19:58:57 -04:00
irungentoo
77d2ad373a
Fixed IP_Port packed struct being 1 byte too big on windows. 2014-05-18 16:07:26 -04:00
irungentoo
906969d376
Fixed out of bounds write. 2014-05-18 14:43:32 -04:00
irungentoo
0035cfac37
Merge branch 'tcp-bootstrap-daemon' of https://github.com/nurupo/InsertProjectNameHere into nurupo-tcp-bootstrap-daemon 2014-05-18 14:22:58 -04:00
irungentoo
376eecafd3
Fixed possible connection issue. 2014-05-18 13:58:41 -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
8cb3ddda8b
Fixed TCP client connection isse. 2014-05-18 12:59:21 -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
Maxim Biro
7dd811214a Added MOTD functionality 2014-05-18 00:38:20 -04:00
Maxim Biro
e75930e72e Some small fixes 2014-05-17 21:49:57 -04:00
Maxim Biro
8be6b0986d Extracted min and max allowed port values into named constants 2014-05-17 21:49:51 -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
Maxim Biro
ceaeae8cff Added TCP server functionality 2014-05-17 20:36:16 -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
80e4e5663f
Fixed bug in TCP server where memory was expected to be zero but
sometimes wasn't.
2014-05-17 14:29:28 -04:00
irungentoo
3aef4711ce
Added function to set the DHT public key in onion_client. 2014-05-17 13:16:58 -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
933428b899
Removed non spec behaviour. 2014-05-16 14:09:46 -04:00
irungentoo
1f7d8b71f0
Fixed TCP_client connections not timing out correctly. 2014-05-16 13:42:19 -04:00
irungentoo
cda3cedd37
TCP_server fix.
Clear the connections array when connection is killed.

Don't allow duplicate entries in connections array.
2014-05-16 12:43:53 -04:00
irungentoo
297281dea5
Fixed some issues in TCP_server.
Timed out connections now remove themselves correctly.

If a peer with the same public key as another tries to connect,
the old connection is killed.
2014-05-16 11:26:41 -04:00
irungentoo
a514167952
Exposed and tested disconnect notification TCP packets. 2014-05-15 20:57:55 -04:00
irungentoo
1e7164fcee
Fixed possibility that packet_send_rate would get stuck. 2014-05-15 16:49:39 -04:00
irungentoo
c5559e192d
Added OOB packets to the TCP client and server. 2014-05-14 17:15:43 -04:00
irungentoo
0b2c44a708
It's bad to have more than one path with the same first node in the
same path array.
2014-05-14 12:08:30 -04:00
irungentoo
8afe4a4fd7
Really fixed TCP_test. 2014-05-14 06:30:05 -04:00
irungentoo
c2523a3c67
Fixed TCP_test.
TCP_test now tests set_tcp_connection_number.
2014-05-13 20:52:34 -04:00
irungentoo
6b1578af3d
TCP_client callbacks now have a per connection number that can be set. 2014-05-13 18:09:38 -04:00
irungentoo
a05ab89dbf
pack/unpack nodes can now pack and unpack TCP nodes. 2014-05-13 14:53:59 -04:00
irungentoo
a5ff3f8aff
Nodes already in the DHT closelist should not be added to the toping list. 2014-05-13 12:14:09 -04:00
irungentoo
8d50e4a866
Fixed tox_test sometimes timing out. 2014-05-13 12:09:40 -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
5b58da35f9
Fixed segfault. 2014-05-12 19:48:19 -04:00
irungentoo
53cc5ea6a9
Fixed onion test. 2014-05-12 19:43:44 -04:00
irungentoo
8783bea25e
Use ping_array to store onion announce information instead of sending
over a huge cookie.

This reduces the size of the onion announce packets by 100 bytes.
2014-05-12 14:39:12 -04:00
irungentoo
10da970e0d
Added ping_array, a special efficient array for use in operations
that require sending ping type packets.

Made ping packets use it.
2014-05-12 14:07:03 -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
ff4368add7
Fixed build by adding librt to build system. 2014-05-10 16:09:44 -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
a26ced5fcb
Merge branch 'master' into TCP 2014-05-08 18:26:01 -04:00
irungentoo
89022326d3
Fixed major denial of service issue. 2014-05-08 18:07:51 -04:00
irungentoo
98f20c76de
Connection between toxes is lossless once again. 2014-05-08 18:04:46 -04:00
irungentoo
9fccb80eec
Fixed bug.
memcmp is easy to confuse visually with memcpy but they do very different
things.

It was also comparing (copying) the senders real public key with their DHT
public key.
2014-05-07 14:18:14 -04:00