Commit Graph

57 Commits

Author SHA1 Message Date
irungentoo 50e0802a62 Removed useless parameter from new_TCP_server() 2015-06-28 22:14:54 -04:00
irungentoo 405558258d Enable SO_REUSEADDR on TCP server socket. 2015-04-11 20:24:39 -04:00
irungentoo a2df5f2f57 Increased max possible amount of TCP connections in TCP server when using epoll. 2015-04-01 13:31:28 -04:00
irungentoo 972e6a9ac5 Use edge trigger on listen socket in TCP_Server.
This may or may not improve things.
2015-02-23 14:46:38 -05:00
irungentoo 085f90432f When socket dies, kill it.
Use epoll to detect when socket closed connection.
2015-02-22 19:45:28 -05:00
irungentoo bca649fa67 Fixed possible TCP server bug.
Function returned success when should have returned failure.
2015-02-21 21:33:34 -05:00
irungentoo 55b4484305 kill_TCP_server() now frees everything in TCP server. 2015-02-07 14:19:55 -05:00
irungentoo 5e1d6f5183 Fix TCP server regression.
onion.c was parsing recieved packets a bit too strictly and discarding
packets that had ips with non valid families.

TCP uses a non valid family to send back the packet to the proper
connected node.
2015-01-13 15:04:41 -05:00
irungentoo c2e394c5c2 Fixed bug with auto tests and cleaned up the code a bit. 2014-12-26 20:12:51 -05:00
xor2003 0ce68b994e Initialise source.port to prevent garbage value 2014-10-17 16:15:22 +04:00
irungentoo 411457dc8f Fixed gcc warnings. 2014-08-28 20:54:05 -04:00
irungentoo bbfa9efff6 Merge branch 'lobiCode-myChan' 2014-08-26 20:21:25 -04:00
slaniCode f1ed0eeabb fix the memory leak in new_TCP_server function 2014-08-27 02:00:52 +02:00
irungentoo c3818ac91f Use epoll_create() instead of epoll_create1() for compatibility with
older kernels.
2014-07-22 12:02:24 -04:00
irungentoo bcfb1261ac Fixed possible bug with TCP nonce not getting incremented. 2014-07-16 20:39:58 -04:00
irungentoo 0486510edc Merge branch 'notsecure-split-video' 2014-07-15 20:00:02 -04:00
notsecure 96249e8b02 fixed some issues 2014-07-15 18:22:04 -04:00
notsecure 22d28ddf36 added priority packet system for TCP server 2014-07-15 17:40:21 -04:00
irungentoo ae7a11cae9 Fixed TCP bug.
Packet was being copied with a wrong, smaller length.
2014-07-15 13:39:32 -04:00
irungentoo 078d60ab92 Fixed bug with TCP.
Don't increment nonce if packet was discarded instead of being sent.
2014-07-15 12:35:57 -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 ece7e535f3 Const-correctness for TCP_server.c 2014-06-30 21:52:07 +02:00
Maxim Biro a32d270330 Reduced number of realloc calls bs_list does 2014-06-20 20:22:03 -04:00
Tux3 / Mlkj / !Lev.uXFMLA dee6c72d2c Fix redundant assignment in TCP_server.c 2014-06-20 13:52:23 +02:00
Marc Schütz 4940c4c62b Const correctness for various packet callbacks 2014-06-13 22:55:15 +02:00
irungentoo 7adefb6e6b Renamed list functions to fix conflict issue on certain machines. 2014-06-06 13:23:21 -04:00
irungentoo 9d53bc5d1d This function only needs to be ran once per second when epoll is
enabled because all it does then is send pings and check timeouts
which are calculated by the second.
2014-05-24 22:20:24 -04:00
irungentoo ad28acd18e Fixed an issue in list.
Cleaned up TCP server a bit.
2014-05-22 17:12:46 -04:00
notsecure 2c8f6ffc3f epoll for tcp server 2014-05-20 20:46:51 +00:00
notsecure 6eae3d5ad7 fixed some mistakes 2014-05-20 09:21:26 -04:00
notsecure b034be4162 use LIST in TCP_server 2014-05-20 07:08:03 -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 933428b899 Removed non spec behaviour. 2014-05-16 14:09:46 -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 c5559e192d Added OOB packets to the TCP client and server. 2014-05-14 17:15:43 -04:00
irungentoo a26ced5fcb Merge branch 'master' into TCP 2014-05-08 18:26:01 -04:00
irungentoo 1bfe15ee88 Decided pretty much how the handshake would work.
Started writing the code.

Astyled some files.
2014-04-22 20:28:40 -04:00
irungentoo 9c6a8432ce Crypto related cleanups.
Moved Bunch of functions from net_crypto to crypto_core.

decrypt_data_fast and decrypt_data_symmetric were the same thing
therefore, removed decrypt_data_fast.

Replaced all the crypto_secretbox_* defines with the equivalent
crypto_box_* one.

New define: crypto_box_KEYBYTES that is equal to
crypto_box_BEFORENMBYTES.
2014-04-21 16:51:36 -04:00
irungentoo 47fb2e8067 Fixed build issues. 2014-04-17 20:53:12 -04:00
Carlos E. Garcia cf33c2f9ad multiple spelling fixes 2014-04-16 12:14:44 -04:00
Steven Noonan ecf0ff3e7f sockets: support Mac OS X way of disabling SIGPIPE on a socket
Mac OS X doesn't have MSG_NOSIGNAL, so we need to use SO_NOSIGPIPE.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
2014-04-13 04:01:38 -07:00
irungentoo 881e95671a Some code written for the TCP part. 2014-04-11 22:09:04 -04:00
irungentoo bd0d24fc9c Added TCP_client.
Some work done on the TCP part.
2014-04-06 20:51:03 -04:00
irungentoo c8ab29632b Some code cleanups. 2014-04-02 18:02:53 -04:00
irungentoo 27a7bf5b1e TCP server now sends/handles ping packets. 2014-03-30 20:56:59 -04:00
irungentoo 98cba889a7 TCP server now has onion functionality.
All the IP/Port related structs now have __attribute__ ((__packed__))
2014-03-29 22:19:03 -04:00
irungentoo 8aaa5fe996 TCP server almost ready. 2014-03-28 22:37:42 -04:00
irungentoo 249d2d9eb7 TCP server testing in progress. 2014-03-26 20:55:14 -04:00
irungentoo 441198f212 Basic TCP server stuff should be all done, started testing it. 2014-03-25 21:03:50 -04:00