Commit Graph

618 Commits

Author SHA1 Message Date
Andy Wang
2bcb4a406d
Fix RecvDataFromRemote benchmark 2020-12-31 12:28:40 +00:00
Andy Wang
603b614009
Control flow optimisation in picking switchboard strategy 2020-12-29 23:58:18 +00:00
Andy Wang
b4d65d8a0e
Use sync.Map for lock free pickRandConn 2020-12-29 19:53:14 +00:00
Andy Wang
8ab0c2d96b
Redo the implementation of switchboard and remove the need for connId 2020-12-29 14:24:54 +00:00
Andy Wang
4a2eac51fe
Cleanup some tests using testify/assert 2020-12-29 01:24:32 +00:00
Andy Wang
8dd4ae4bef
Better conform message data length to TLS standards 2020-12-29 00:16:24 +00:00
Andy Wang
439b7f0eb3
Improve encapsulation 2020-12-28 12:15:01 +00:00
Andy Wang
65443da872
Merge branch 'master' into obfs-fix 2020-12-28 12:09:44 +00:00
Andy Wang
2c709f92df
Correctly assign payloadCipher to Obfuscator field, and add test for this issue 2020-12-28 12:04:32 +00:00
Andy Wang
eee8209195
Revert "Refactor obfuscate and deobfuscate functions to reduce a layer of indirection"
This reverts commit 415523f1

See issue #149
2020-12-28 10:13:10 +00:00
Andy Wang
5cb54aa3c9
Correctly fallthrough to fix client configuration compatibility 2020-12-28 09:15:40 +00:00
Andy Wang
fd695db044
Reduce unnecessary test bloat 2020-12-28 01:27:40 +00:00
Andy Wang
c60c6d8ddb
Avoid assigning functions to variables in hot path 2020-12-28 01:25:22 +00:00
Andy Wang
661db9d083
Correctly copy frame payload in frame sorter 2020-12-28 00:48:41 +00:00
Andy Wang
f322f8b47f
Randomise echo test data 2020-12-28 00:48:16 +00:00
Andy Wang
8fbb2dd8cc
Add more data reception tests 2020-12-28 00:29:56 +00:00
Andy Wang
23b32b603f
Latency benchmark 2020-12-27 22:01:41 +00:00
Andy Wang
e0b97db7cc
Add unordered benchmark for RecvDataFromRemote 2020-12-27 21:40:59 +00:00
Andy Wang
57bb437802
Log timestamp 2020-12-27 20:27:04 +00:00
Andy Wang
d1b05ee9e5
Add new encryption method option aes-128-gcm 2020-12-27 13:26:45 +00:00
Andy Wang
cbd71fae6d
Control flow optimisations 2020-12-26 16:34:25 +00:00
Andy Wang
3ad04aa7e9
Add latency benchmark 2020-12-26 15:36:38 +00:00
Andy Wang
2d08e88efb
Use a sync.Pool to remove the global random bottleneck in picking a random conn 2020-12-26 13:48:42 +00:00
Andy Wang
415523f10a
Refactor obfuscate and deobfuscate functions to reduce a layer of indirection 2020-12-26 00:49:36 +00:00
Andy Wang
2f17841f85
Use Compare-And-Swap for atomic booleans indicating session and switchboard closed 2020-12-25 23:16:57 +00:00
Andy Wang
4f34e69006
Use pooled buffer for session closing frame 2020-12-24 13:42:22 +00:00
Andy Wang
881f6e6f9d
Use sync.Pool for obfuscation buffer 2020-12-24 11:35:29 +00:00
Andy Wang
5933ad8781
Replace bytes.Buffer with vanilla []byte in tls wrapper 2020-12-24 10:26:53 +00:00
Andy Wang
4209483a48
Reduce memory pressure in tests 2020-12-23 23:58:47 +00:00
Andy Wang
3b24c33e78
Remove incorrect concurrent uses of testing.T.Fatal 2020-12-23 23:12:51 +00:00
Andy Wang
70a9723377
Temp fix to testing reading after closing a stream 2020-12-23 22:34:26 +00:00
Andy Wang
a97f5759c0
Fix race condition in tests 2020-12-23 22:34:12 +00:00
Andy Wang
0209bcd977
Fix race condition in steam closing. Fall back to temp buffer allocation 2020-12-23 22:33:01 +00:00
Andy Wang
53f0116c1d
Fix race condition in the use of assert.Eventually 2020-12-23 17:43:18 +00:00
Andy Wang
9108794362
Fix race condition in allocating obfsBuf 2020-12-23 17:42:54 +00:00
Andy Wang
5c5e9f8c14
Prevent unnecessary allocation in stream closing 2020-12-23 17:28:28 +00:00
Andy Wang
3e737717bd
Use assert.Eventually to correctly handle more timing sensitive tests 2020-12-23 12:25:58 +00:00
不确定
dc030fbb47
Implement UDP stream timeout. (#148)
* Implement UDP stream timeout.

* Correctly delete streams from map after closing

Co-authored-by: Andy Wang <cbeuw.andy@gmail.com>
2020-12-23 00:43:38 +00:00
Andy Wang
4d1612774f
Use a buffer pool to reduce contentions in tls wrapper 2020-12-23 00:02:25 +00:00
Andy Wang
35f41424c9
Use default hashmap to store streams. Avoid allocating a stream object on receiving every single frame 2020-12-22 20:21:40 +00:00
Andy Wang
fd5005db0a
Fix a timing sensitive test on reading data after actively closing a stream 2020-12-22 20:16:47 +00:00
Andy Wang
ff503b06a8
Only allocate and copy frame object into sorter heap when necessary (out of order frame) 2020-12-22 19:39:13 +00:00
Andy Wang
5a3f63f101
Reduce allocation of frame objects on receiving data 2020-12-22 14:45:29 +00:00
Andy Wang
104117cafb
Fix one instance of not accessing recvBuf via the getter 2020-12-22 14:32:41 +00:00
Andy Wang
4bc80af9a1
Lazily allocate stream receiving buffer 2020-12-22 14:12:00 +00:00
Andy Wang
badda76454
Improve data receive benchmark 2020-12-22 13:40:37 +00:00
Andy Wang
42f36b94d3
Achieve zero allocation when writing data through stream 2020-12-22 13:16:48 +00:00
Andy Wang
3633c9a03c
Fix multiplex test as test payload length may be randomised to 0 2020-12-22 12:39:39 +00:00
Andy Wang
c9ac93b0b9
Refactor session_test.go 2020-12-21 20:38:28 +00:00
Andy Wang
de0daac123
Update deprecated curve25519 functions and defend against low-order point attacks 2020-12-21 16:37:33 +00:00