-
Notifications
You must be signed in to change notification settings - Fork 325
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
User-aware relay address generator #422
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #422 +/- ##
==========================================
+ Coverage 66.63% 67.43% +0.80%
==========================================
Files 43 43
Lines 2919 2933 +14
==========================================
+ Hits 1945 1978 +33
+ Misses 807 793 -14
+ Partials 167 162 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Thanks a lot, this makes the code much leaner. I guess we'll have to wait for @Sean-Der to merge this though because API changes will require a new release (I guess we'll be at v5 already!). |
The basic idea is sound, but we're breaking backwards compatibility for a fairly ad hoc feature. If we're going to break compatibility, why don't we do it right, so that we don't need to break it again in the future? I would suggest defining a new type:
and passing that as the new argument. This way, if we ever feel the need to add extra parameters, we can just add them to |
Agreed. I will update the code. |
As I was making changes, i had a couple of thoughts: Name the context as
AllocationContext |
That will cause confusion with (I'll review your code later.) |
"allocation context" feel right to me, but I agree that it could be confused by context.Context. I had following candidate in my head:
(I will fix the lint error later - I have just noticed) |
Updated the code, and fixed the lint error also. |
Metadata is fine. (Although frankly, why not just use Perhaps you could squash the commits, it would make review easier? |
Thanks @jech, I have squashed the commits. I feel "metadata" is a suitable term because it represents contextual information related to the operation. It is not primary data, such as network or port number, nor is it a parameter required for the operation. Instead, it serves as supplemental information. |
Resolves #420
Description
Details of this feature are described in #420.
This PR make following changes:
username
argument to AllocatePacketConn and AllocateConn callback methods in RelayAddressGeneratorNOTCE: This is a breaking change for TURN server applications.
Reference issue
Fixes #420