Commit Graph

75 Commits

Author SHA1 Message Date
Andy Wang
783d016a29 Fix a race on closing stream 2020-04-12 01:35:17 +01:00
Andy Wang
58e0797578 Synchronise stream.Write 2020-04-12 01:34:21 +01:00
Andy Wang
008fd8f0a3 Lazy allocation 2020-04-12 00:49:49 +01:00
Andy Wang
e9243a2e9f Framing in Stream.Write to prevent silent short write 2020-04-10 18:48:36 +01:00
Andy Wang
a51d45f41a Avoid unnecessary pass by pointer 2020-04-10 16:09:05 +01:00
Andy Wang
e41394c83c Set frame size limit through multiplexer 2020-04-09 16:37:46 +01:00
Andy Wang
7bfae8accd Refactor client side transport (breaks server) 2020-04-08 20:53:09 +01:00
Andy Wang
2dc7c6d6e1 Correct switchboard valve's scope 2020-04-08 15:15:08 +01:00
Andy Wang
e52daf1a39 Set defaults properly 2020-04-08 15:13:49 +01:00
Andy Wang
545164a300 Make send/receive buffer sizes configurable 2020-04-08 15:07:35 +01:00
Andy Wang
01e5d15d20 Code cleanup 2020-04-08 12:18:20 +01:00
Andy Wang
c1f3408c2c Make key lengths explicit 2020-04-07 21:15:28 +01:00
Andy Wang
e9afae72f0 better stream closing error message 2020-04-05 00:51:28 +01:00
Andy Wang
47410dbb97 add comments 2020-03-15 23:56:45 +00:00
Andy Wang
517a6d6e57 Handle error and retry for Crypto.rand 2020-02-01 23:46:46 +00:00
Andy Wang
6f34229aa0 Make and add stream upon reception of all new streamIDs even if they are closing 2020-01-23 20:30:31 +00:00
Andy Wang
3f5fdae284 Close session immediately after receiving signal 2020-01-22 21:30:30 +00:00
Andy Wang
d65aee725a Improve stream closing logic and add tests 2020-01-22 21:12:32 +00:00
Andy Wang
e7e4cd5726 Refactor frame reception processor 2020-01-09 10:22:40 +00:00
notsure2
d35472aea1 Store stream in packet receive path instead of asynchronously to fix https://github.com/cbeuw/Cloak/issues/74 2019-12-14 12:48:45 +00:00
Andy Wang
fbee919f47 Use constants for Closing value 2019-11-03 20:28:43 +00:00
Andy Wang
c26be98e79 Use sync.Map in multiplex instead of manual locks 2019-11-03 12:22:12 +00:00
Andy Wang
a1b719b15f Add terminal message 2019-10-15 22:24:33 +01:00
Andy Wang
3b3cd277f8 Fix stream not closing 2019-10-15 22:06:11 +01:00
Andy Wang
6580e38e44 Introduce a special Session closing frame 2019-10-14 15:34:14 +01:00
Andy Wang
c9318dc90b Fix potential deadlocks 2019-10-08 23:11:16 +01:00
Andy Wang
339b324946 Working direct WebSocket transport 2019-09-01 20:23:45 +01:00
Andy Wang
3f532ae065 writeFrame returns error 2019-08-30 20:43:04 +01:00
Andy Wang
2006e5971a Refactor frameSorter and datagramBuffer under one interface 2019-08-22 11:48:10 +01:00
Andy Wang
87a7684e10 More comments 2019-08-20 22:43:04 +01:00
Andy Wang
eabe113547 Add Stream Timeout 2019-08-19 23:23:41 +01:00
Andy Wang
ba467e8a32 Only store stream in map after Accept 2019-08-19 11:31:56 +01:00
Andy Wang
52796ad0b1 recvDataFromRemote returns err 2019-08-16 23:47:15 +01:00
Andy Wang
e9a3c29429 Add some tests 2019-08-16 23:39:41 +01:00
Andy Wang
c19c43f6e8 Server side UDP to proxy server 2019-08-14 11:56:55 +01:00
Andy Wang
c36ec04ce5 Add unordered mode 2019-08-14 11:56:55 +01:00
Qian Wang
71e48a1947 Refactor switchboard configuration and add unordered option 2019-08-12 00:48:20 +01:00
Qian Wang
cb672a99de Refactor session configuration 2019-08-12 00:22:15 +01:00
Qian Wang
b7549c0664 Fix a potential nil pointer 2019-08-07 17:06:48 +01:00
Qian Wang
d99b4009b2 Differentiate concrete types of LimitedValve and UnlimitedValve to avoid unnecessary atomic.AddUint64 since it has non-trivial overhead on embedded systems 2019-08-07 15:43:42 +01:00
Qian Wang
3dc4c6fb3f Add more trace logs 2019-08-06 11:19:47 +01:00
Qian Wang
01036086c7 Change the frame distribution strategy so that each stream is assigned a fixed underlying TCP connection to send its frames to reduce framesorter ooo count 2019-08-05 22:14:11 +01:00
Qian Wang
fac381dbca Refactor switchboard 2019-08-05 14:33:20 +01:00
Qian Wang
e75c713385 Refactor session struct's obfs fields 2019-08-02 16:37:48 +01:00
Qian Wang
33f232475d Improve logging 2019-08-02 15:45:33 +01:00
Qian Wang
726a405a26 TLS1.3 2019-08-02 01:01:19 +01:00
Qian Wang
6af97e2c22 Optimise session closing 2019-07-28 23:27:59 +01:00
Qian Wang
059a222394 Use defer to unlock mutexes 2019-07-28 12:52:57 +01:00
Qian Wang
8f9922b06b Add terminal messages upon session closing 2019-07-25 20:57:02 +01:00
Qian Wang
2ce6f380d1 Implement admin control through a tunneled RESTful API 2019-07-25 12:17:29 +01:00