forked from fortuna/ss-example
-
Notifications
You must be signed in to change notification settings - Fork 198
refactor: allow hot swapping the config #192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
64 commits
Select commit
Hold shift + click to select a range
cf9b7d2
Refactor how we create listeners.
sbruens ae7f41d
Update comments.
sbruens 120db8e
`go mod tidy`.
sbruens d705603
refactor: don't link the TCP handler to a specific listener
sbruens 2fb4a6b
Merge branch 'sbruens/remove-listener-dependency' into sbruens/shared…
sbruens d2ef46e
Protect new cipher handling methods with mutex.
sbruens ab07400
Move `listeners.go` under `/service`.
sbruens 71d7140
Use callback instead of passing in key and manager.
sbruens 9dfa4e2
Move config start into a go routine for easier cleanup.
sbruens 0a63f5c
Make a `StreamListener` type.
sbruens f018d17
Rename `closeFunc` to `onCloseFunc`.
sbruens 4295c45
Rename `globalListener`.
sbruens e6963f6
Don't track usage in the shared listeners.
sbruens 7113f02
Add `getAddr()` to avoid some duplicate code.
sbruens e4d679f
Move listener set creation out of the inner function.
sbruens be5f9b0
Remove `PushBack()` from `CipherList`.
sbruens 343e412
Move listener set to `main.go`.
sbruens 7f86ff1
Close the accept channel with an atomic value.
sbruens e80b2c5
Update comment.
sbruens b1428ed
Address review comments.
sbruens 1c16de8
Close before deleting key.
sbruens ebc7053
`server.Stop()` does not return a value
sbruens 67fc7fb
Add a comment for `StreamListener`.
sbruens 7a15e7d
Do not delete the listener from the manager until the last user has c…
sbruens 499829e
Consolidate usage counting inside a `listenAddress` type.
sbruens f165dbd
Remove `atomic.Value`.
sbruens 2a2420a
Add some missing comments.
sbruens 8178d78
Merge branch 'master' into sbruens/shared-listeners
sbruens cccba1a
address review comments
sbruens da4ccaa
Add type guard for `sharedListener`.
sbruens d47f612
Stop the existing config in a goroutine.
sbruens a928e2c
Add a TODO to wait for all handlers to be stopped.
sbruens 98cc3a0
Run `stopConfig` in a goroutine in `Stop()` as well.
sbruens 48d0931
Create a `TCPListener` that implements a `StreamListener`.
sbruens 2dec847
Track close functions instead of the entire listener, which is not ne…
sbruens ab22e47
Delegate usage tracking to a reference counter.
sbruens 3c2a3ef
Remove the `Get()` method from `refCount`.
sbruens 5e282f1
Return immediately.
sbruens 547e9e6
Rename `shared` to `virtual` as they are not actually shared.
sbruens c6774c8
Simplify `listenAddr`.
sbruens df2f9d0
Fix use of the ref count.
sbruens c678372
Add simple test case for early closing of stream listener.
sbruens e41abab
Add tests for creating stream listeners.
sbruens 6b11f4f
Refactor create methods.
sbruens fe8bbdd
Address review comments.
sbruens 36a0a1d
Use a mutex to ensure another user doesn't acquire a new closer while…
sbruens aeb2652
Move mutex up.
sbruens 8873b10
Manage the ref counting next to the listener creation.
sbruens 899d13d
Do the lazy initialization inside an anonymous function.
sbruens 80e5d49
Fix concurrent access to `acceptCh` and `closeCh`.
sbruens aa00f2e
Use `/` in key instead of `-`.
sbruens e658b90
Return error from stopping listeners.
sbruens fede4d8
Use channels to ensure `virtualPacketConn`s get closed.
sbruens 4730d74
Add more test cases for packet listeners.
sbruens 458cf41
Only log errors from stopping old configs.
sbruens 81bf20e
Remove the `closed` field from the virtual listeners.
sbruens 53b1e96
Remove the `RefCount`.
sbruens 8f9f1ea
Implement channel-based packet read for virtual connections.
sbruens 1ac265d
Use a done channel.
sbruens 1538a9a
Set listeners and `onCloseFunc`'s to nil when closing.
sbruens 4df0b9f
Set `onCloseFunc`'s to nil when closing.
sbruens 16feaf9
Fix race condition.
sbruens 288b88b
Add some benchmarks for listener manager.
sbruens d688dd9
Merge branch 'master' into sbruens/shared-listeners
sbruens File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.