David Fifield
bb2126b7c6
Use %w, not %v, in fmt.Errorf, so errors can be unwrapped.
...
https://go.dev/blog/go1.13-errors#wrapping-errors-with-w
2024-08-21 17:00:18 -04:00
David Fifield
f25b293fb5
Comment typo.
2024-08-02 03:36:37 +00:00
David Fifield
ee5f815f60
Cosmetic changes from dev-snowflake-udp-rebase-extradata.
...
https://gitlab.torproject.org/shelikhoo/snowflake/-/tree/dev-snowflake-udp-rebase-extradata
commit 59b76dc68d2ee0383c2acd91cb0f44edc46af939
2024-08-01 22:12:56 +00:00
David Fifield
1bde730b39
Comment typo.
2024-03-22 00:43:58 +00:00
David Fifield
d0529141ac
Cosmetic fixes taken from !219 .
...
shelikhoo/dev-udp-performance-rebased branch
https://gitlab.torproject.org/shelikhoo/snowflake/-/commits/9dce28cfc2093490473432ffecd9abaab7ebdbdb
2024-01-16 18:43:58 +00:00
David Fifield
d99f31d881
Have encapsulation.ReadData return an error when the buffer is short.
...
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/merge_requests/154#note_2919109
Still ignoring the io.ErrShortBuffer at the callers, which retains
current behavior.
2023-11-07 05:51:35 +00:00
David Fifield
001f691b47
Have encapsulation.ReadData read into a provided buffer.
...
Instead of unconditionally allocating its own.
2023-11-07 05:51:35 +00:00
meskio
82cc0f38f7
Move the development to gitlab
...
Related: tpo/anti-censorship/team#86
2023-05-31 10:01:47 +02:00
David Fifield
c097d5f3bc
Use a sync.Pool to reuse packet buffers in QueuePacketConn.
...
This is meant to reduce overall allocations. See past discussion at
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40260#note_2885524 ff.
2023-04-04 20:22:32 -06:00
David Fifield
6bdd48c006
Restore ListenAndServe error return in Transport.Listen.
...
This error return was lost in 11f0846264
;
i.e. !31 .
Fixes #40043 .
2023-04-03 00:18:26 -06:00
David Fifield
936a1f8138
Add a num-turbotunnel server transport option.
...
Replaces the hardcoded numKCPInstances.
2022-12-14 23:02:26 -07:00
David Fifield
c6fabb212d
Use multiple parallel KCP state machines in the server.
...
To distribute CPU load.
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40200
2022-12-14 23:02:26 -07:00
David Fifield
77b186ae6e
Have SnowflakeClientConn implement io.WriterTo.
...
By forwarding the method to the inner smux.Stream. This is to prevent
io.Copy in the top-level proxy function from allocating a buffer per
client.
The smux.Stream WriteTo method returns io.EOF on success, contrary to
the contract of io.Copy that says it should return nil. Ignore io.EOF in
the proxy loop to avoid a log message.
/anti-censorship/pluggable-transports/snowflake/-/issues/40177
2022-12-08 08:03:54 -07:00
David Fifield
8e5af50bdb
Increase clientIDAddrMapCapacity to 98304.
...
Recent increases in usage have exhausted the capacity of the map.
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40173
2022-12-03 13:39:56 -07:00
David Fifield
2f55581098
Reduce the smux KeepAliveTimeout on the server from 10 to 4 minutes.
...
To save memory, we want to more aggressively close stale connections.
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40175
2022-11-16 18:48:14 +01:00
trinity-1686a
5ef5142bb0
format using go-1.19
2022-10-09 21:15:50 +02:00
Cecylia Bocovich
bcc162898a
Initialize SnowflakeListener.closed
...
Fixes a bug where an uninitialized channel causes a panic when closed
(#40099 ).
2022-02-08 13:00:43 -05:00
Cecylia Bocovich
c0b35076c9
Remove support for oneshot mode
...
Due to a bug (#40098 ), legacy oneshot connections have not worked for
awhile. Connections without the turbotunnel token would cause the server
to crash. This fixes that bug by removing support altogether and simply
closes the connection.
2022-02-07 11:39:23 -05:00
Shelikhoo
d2f6ea5417
increase clientIDAddrMapCapacity
...
See also:
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40084
2022-01-18 14:33:34 -05:00
Shelikhoo
50646698e3
Suppress connection end log output
...
This is an amendment of https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/merge_requests/30
2022-01-18 14:33:27 -05:00
Cecylia Bocovich
ead5a960d7
Bump snowflake library imports and go.mod to v2
2021-11-11 10:14:49 -05:00
Cecylia Bocovich
04ba50a531
Change package name and add a package comment
2021-10-07 11:01:33 -04:00
Cecylia Bocovich
4623c7d3e1
Add documentation where necessary for exported items
2021-10-07 11:01:33 -04:00
Cecylia Bocovich
5339ed2dd7
Stop exporting internal code
2021-10-07 11:01:33 -04:00
Cecylia Bocovich
e6715cb4ee
Increase smux and QueuePacketConn buffer sizes
...
This should increase the maximum amount of inflight data and hopefully
the performance of Snowflake, especially for clients geographically
distant from proxies and the server.
2021-08-10 15:38:11 -04:00
Cecylia Bocovich
6634f2bec9
Store net.Addr in clientIDAddrMap
...
This fixes a stats collection bug where we were converting client
addresses between a string and net.Addr using the clientAddr function
multiple times, resulting in an empty string for all addresses.
2021-06-19 11:16:38 -04:00
Cecylia Bocovich
7c9005bed3
Ensure turbotunnel read and write loop terminate
...
Introduce a waitgroup and done channel to ensure that both the read and
write gorouting for turbotunnel connections terminate when the
connection is closed.
2021-05-12 09:32:07 -04:00
Cecylia Bocovich
11f0846264
Implement server as a v2.1 PT Go API
2021-05-12 09:08:41 -04:00