Commit Graph
223 Commits
Author SHA1 Message Date
Jakob Borg a65cf5791e Add a magic word in front of the header
This identifies the connection as a Syncthing connection, makes it look
less like uTP for interested viewers. Passes the test suite here, and
works when copied into our vendoring directory.
2016-05-26 15:18:31 +02:00
Matt Joiner d529dcb23b Terminate extension chains when marshalling header
This is important if the buffer is being reused, and isn't necessarily zeroed.
2016-05-26 22:13:24 +10:00
Matt Joiner 0a3e0d100a Don't do resends in a separate goroutine
~10% performance improvement
2016-05-26 15:13:26 +10:00
Matt Joiner 0950f6188a Bump to 20MB echo test 2016-05-26 15:12:50 +10:00
Matt Joiner fc1b0ce1d6 TestMain: Wait a second for sockets to be closed before writing status 2016-05-26 15:10:44 +10:00
Matt Joiner 3c03170741 Avoid a small allocation 2016-05-26 15:09:46 +10:00
Matt Joiner cc6c46a38d Add Echo benchmark 2016-05-26 15:09:25 +10:00
Matt Joiner e64a46c6c6 Slow down the raw UTP test 2016-05-23 09:32:51 +10:00
Matt Joiner f203455078 Clean up accept code 2016-05-14 13:59:06 +10:00
Matt Joiner 2f283dacc4 Observations while fixing the last 2016-05-14 13:15:41 +10:00
Matt Joiner fb5d273ddc Socket didn't have a destroyed Event, Accept would never return without explicit Close despite error 2016-05-14 13:15:19 +10:00
Matt Joiner ea7646aa4a Add TestAcceptOnDestroyedSocket
Noticed by @whyrusleeping
2016-05-14 13:04:48 +10:00
Matt Joiner 7a25702542 Improve consistency of TestWriteUnderlyingPacketConnClosed 2016-05-14 13:03:58 +10:00
Matt Joiner 2ae532de0f missinggo.Event changes 2016-05-07 18:59:21 +10:00
Matt Joiner e509da3316 Don't do send buffer allocation in header.Marshal, and don't allocate minMTU for outgoing non-data packets, throw away sendBufferPool
sendBufferPool will be easier to work with in the future with allocation no longer occuring in header.Marshal. I'm not even sure it's necessary.
2016-04-30 04:06:29 +10:00
Matt Joiner 40801b2499 Track how many state packets are saved by batching them 2016-04-29 21:21:13 +10:00
Matt Joiner f40a4e70a4 Missed hunk from last commit
Fixes #11.
2016-04-29 20:52:37 +10:00
Matt Joiner 96252a858d Fix handling of net.Addr.Network throughout, and create a utp addr type
Fixes #11.
2016-04-29 20:50:24 +10:00
Matt Joiner e5dca62cbd Cap the read buffer to 1MiB, test Conn write deadline, and large transfer 2016-04-26 23:43:03 +10:00
Matt Joiner 5eef1671c7 Tidy up write 2016-04-26 23:16:42 +10:00
Matt Joiner 68ec4a72c8 Trial a dedicated read sync.Cond for improved performance
I tried channels and they're just too slow. Read events occur too quickly.
2016-04-26 12:48:06 +10:00
Matt Joiner a0d40bd787 Remove dedicated Conn.deliveryProcessor goroutine, and fix Conn.deliver deadlock 2016-04-26 01:08:19 +10:00
Matt Joiner e57d077423 Clean up a test 2016-04-24 21:18:02 +10:00
Matt Joiner a3167f3d18 Clean up deadline handling
https://github.com/anacrolix/utp/issues/10
2016-04-24 21:17:41 +10:00
Matt Joiner 276b2e01aa Conn.Write should fail if Socket is destroyed
https://github.com/ipfs/go-ipfs/issues/2566
2016-04-24 20:19:48 +10:00
Matt Joiner 336395439c Rework connPair to use the same Socket for both Conns 2016-04-24 20:02:45 +10:00
Matt Joiner 4ff5ca0f7d Count dropped and unused packets 2016-04-24 20:01:19 +10:00
Matt Joiner bb8da3e04a Doc comments and tidy 2016-04-24 20:00:52 +10:00
Matt Joiner 0163ffe960 Do dispatching inline with the socket reader and destroy socket on read error 2016-04-24 19:58:43 +10:00
Matt Joiner d2fb2b0385 On dial timeout, don't send a FIN, as they'll treat it like EOF 2016-04-22 02:39:16 +10:00
Matt Joiner 78425cef94 TestAcceptGone: Check that SetReadDeadline worked 2016-04-21 22:39:05 +10:00
Matt Joiner c5226b7368 Add some new tests 2016-04-21 22:38:50 +10:00
Matt Joiner c452c69132 Make it easier to set and unset testing and default timeouts 2016-04-21 22:38:16 +10:00
Matt Joiner 719fbbd05e updateStates is just lazyDestroy, and use it in Conn.Write 2016-04-21 22:34:24 +10:00
Matt Joiner 8e5eae6555 Also hook addr resolving for tests 2016-04-21 22:33:32 +10:00
Matt Joiner 6d38c865d7 Use in-memory implementation of PacketConn for tests 2016-04-20 00:01:08 +10:00
Matt Joiner 5486f285e7 Treat closed as gotFin for purposes of destroying Conn after sends are acked 2016-04-19 18:33:01 +10:00
Matt Joiner 974bb7b58f Close triggers EOF on Read 2016-04-19 18:32:09 +10:00
Matt Joiner 83c99a29af registerConn add connKey to Conn only after it's added 2016-04-19 18:29:00 +10:00
Matt Joiner c4b73fb4aa Trigger Conn detach when destroyed 2016-04-19 18:03:24 +10:00
Matt Joiner 3b47958457 Fix naming of Conn.{closing,closed}
Closed means the user has called Close(). Destroyed is when the Conn is being forcefully removed, and no more activity should occur.
2016-04-19 17:45:11 +10:00
Matt Joiner 39b33ffeec Fix nixxing of ackSkipped resend when already acked 2016-04-19 17:35:44 +10:00
Matt Joiner 6865c4baa2 Make resend a fixed method on send 2016-04-19 17:27:18 +10:00
Matt Joiner d313cb3d3d Single global mutex and cond 2016-04-19 11:27:05 +10:00
Matt Joiner 59c10150c5 Break up into smaller files 2016-04-19 10:26:44 +10:00
Matt Joiner a0ed6ae2f3 Don't do TestConnectSelf in parallel 2016-04-18 21:31:00 +10:00
Matt Joiner e597926497 Make the timedOut callback a method 2016-04-18 01:23:18 +10:00
Matt Joiner 2aa2a1db54 Don't resend packet when ack is skipped if it's already acked 2016-04-16 02:49:36 +10:00
Matt Joiner 0035676f02 Tidy up Conn.unackedSends trim logic 2016-04-15 15:49:29 +10:00
Matt Joiner 11118b11ca Nil send function fields once acked
May allow GC to free payload buffers and other captured variables earlier.
2016-04-15 15:49:08 +10:00