235 Commits

Author SHA1 Message Date
Audrius Butkevicius 0a4c2ea815 Merge remote-tracking branch 'upstream/master' into HEAD 2016-05-28 12:57:00 +01:00
Matt Joiner f933e8019e Improve deadline code, and fix breaking of zero deadline 2016-05-28 21:51:06 +10:00
Matt Joiner a198407ec3 Make deadlines work on Socket
Fix #14
2016-05-28 21:24:07 +10:00
Matt Joiner d70ad6c956 Move a bunch of Socket tests into socket_test.go 2016-05-28 21:06:22 +10:00
Matt Joiner ede08cf685 SetBytes and ResetTimer in BenchmarkEchoLongBuffer 2016-05-27 15:28:17 +10:00
Matt Joiner 2cc71fb749 Add BenchmarkSyncthingInprocUTP 2016-05-27 14:38:32 +10:00
Matt Joiner 6c74582ea9 Add Syncthing to benchmark test names 2016-05-27 14:38:07 +10:00
Matt Joiner 6644dc814f Fix socket leak in syncthing test 2016-05-27 14:37:43 +10:00
Matt Joiner a705995975 Add provided benchmark tests from #13 2016-05-27 14:20:53 +10:00
Matt Joiner 11fecf34d2 Fix race condition letting writes through after dial connects 2016-05-27 14:20:32 +10:00
Audrius Butkevicius 1429635b95 Merge pull request #1 from syncthing/syncthingmagic
Add a magic word in front of the header
2016-05-26 20:12:36 +01:00
Matt Joiner 065fae8ee7 Ditch the global condition
It was triggering too often, and reduced performance.
2016-05-27 03:04:43 +10:00
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