Commit Graph

81 Commits

Author SHA1 Message Date
name
e696b18187 format using goimports 2023-03-07 17:09:18 +08:00
Andy Wang
a643402e11
Remove redundant lazy allocation 2020-12-31 23:53:22 +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
415523f10a
Refactor obfuscate and deobfuscate functions to reduce a layer of indirection 2020-12-26 00:49:36 +00:00
Andy Wang
881f6e6f9d
Use sync.Pool for obfuscation buffer 2020-12-24 11:35:29 +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
9108794362
Fix race condition in allocating obfsBuf 2020-12-23 17:42:54 +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
4bc80af9a1
Lazily allocate stream receiving buffer 2020-12-22 14:12:00 +00:00
Andy Wang
42f36b94d3
Achieve zero allocation when writing data through stream 2020-12-22 13:16:48 +00:00
Andy Wang
0f6e0d37b5 Rename constants to camel case 2020-10-21 16:42:24 +01:00
Andy Wang
977f51ce48 Add comments 2020-10-20 01:10:57 +01:00
Andy Wang
64d857c74d Rename variables for clarity 2020-10-18 15:36:40 +01:00
Andy Wang
c7c3f7706d Refactor for clarity and add comments 2020-10-18 14:42:47 +01:00
Andy Wang
3e133090f0 Give more descriptive names to multiplex objects 2020-10-15 22:51:36 +01:00
Andy Wang
1c8903f249 Log repeat stream closing on Debug level 2020-04-20 23:54:41 +01:00
Andy Wang
e202d8d03b Implement WriteTo and ReadFrom timeouts 2020-04-14 14:14:51 +01:00
Andy Wang
53c0c6bafe Explicitly allow buf overlap in obfs 2020-04-13 22:48:28 +01:00
Andy Wang
e03080d3ba Lock stream sending in all cases 2020-04-13 16:39:19 +01:00
Andy Wang
c8368bcc7e Implement stream ReadFrom (flimsy) 2020-04-12 23:01:30 +01:00
Andy Wang
73544c03bb Update comment 2020-04-12 16:35:24 +01:00
Andy Wang
248389b3f6 Make WriteTo return the correct errors 2020-04-12 16:34:49 +01:00
Andy Wang
f05cc19dbc Assign connId only when needed 2020-04-12 12:51:00 +01:00
Andy Wang
14787a7057 Implement stream WriteTo 2020-04-12 12:43:24 +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
5d4e8b8d8d Refactor udp piping and add tests 2020-04-11 22:37:15 +01:00
Andy Wang
e9243a2e9f Framing in Stream.Write to prevent silent short write 2020-04-10 18:48:36 +01:00
Andy Wang
e5bda61587 Close connections properly 2020-04-09 23:52:08 +01:00
Andy Wang
86214a1df0 Implement stream SetReadDeadline 2020-04-09 18:56:17 +01:00
Andy Wang
e41394c83c Set frame size limit through multiplexer 2020-04-09 16:37:46 +01:00
Andy Wang
a461059b4a Change behaviour of stream.Write(nil) 2020-04-08 18:16:54 +01:00
Andy Wang
545164a300 Make send/receive buffer sizes configurable 2020-04-08 15:07:35 +01:00
Andy Wang
d65aee725a Improve stream closing logic and add tests 2020-01-22 21:12:32 +00: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
0bc48a5a2e Remove redundant err checking TODO 2019-08-30 20:45:06 +01:00
Andy Wang
3f532ae065 writeFrame returns error 2019-08-30 20:43:04 +01:00
Andy Wang
a131af3439 Remove unnecessary Len check 2019-08-30 20:39:23 +01:00
Andy Wang
4fb1f55e2d Use 64bit frame Seq to prevent nonce reuse 2019-08-27 15:06:28 +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
c8184fc1d2 Switch back to juju/ratelimit 2019-08-17 11:23:26 +01:00
Andy Wang
44a09219f7 Experimental support for UDP 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
fc9f227ccf stream.Write now returns the correct amount of data written 2019-08-08 10:56:29 +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