Only send audio to clients that have been identified.#1589
Only send audio to clients that have been identified.#1589hoffie merged 7 commits intojamulussoftware:masterfrom
Conversation
hoffie
left a comment
There was a problem hiding this comment.
Thanks! Code looks good.
This will probably prevent Jamulus clients before version 3.4.5 from working with newer servers completely as pointed out in #1243 (comment).
I'm not saying that this is a problem though as those clients already had a vastly degraded user experience (lack of faders or at least fader names), the version is old and there have been no explicit compatibility guarantees for these earlier versions, as far as I understand.
The PR seems to do what the title promises. ;)
#1243 (comment) Option 2 would have also included stopping to accept audio from non-identified clients. Should this also be done? Should it be done as part of this PR?
For me, the undetected eaves-dropping case sounds more important and should be covered by this PR.
Not approving yet as I haven't tested either. :)
| const CVector<uint8_t>& vecbyNPacket, | ||
| const int iNPacketLen ) | ||
| { | ||
| if (bIsServer && !bIsIdentified) |
There was a problem hiding this comment.
Sadly, this is another two checks for each packet of each client, as far as I understand. I don't see a way to change this though and I can't judge what the performance impact is. I'd say that two comparisons should be cheap, but I lack knowledge about how much this is percentage-wise.
There was a problem hiding this comment.
I would think compared with all the other per-channel operations (codec, mixing, etc.), it's infinitesimal.
hoffie
left a comment
There was a problem hiding this comment.
Hrm, I suspect that a bIsIdentified = false is missing somewhere (SetEnable()?) as Channel instances are re-used, IIRC?
|
I have now tested this and it seems to work as expected:
So, regarding correctness only the channel-reuse issue above remains. |
This was one of the things I was planning to check today: the actual lifecycle of a channel instance. |
It might even be an advantage, so long as we pointed out the minimum compatible client version in the release notes. But I'll look to see if we can also easily be compatible with what previous client versions did (send channel name instead of channel info?).
Obviously, it is the reception of audio that creates the channel, but it would be worthwhile excluding an unidentified channel from the mix. I'll look at that. |
As far as I remember, they're a pool (fixed size on server start). Unused entries get reused lowest number first. You can connect, stop your packet stream, connect again, repeat, and use up channels using (currently none or) the same user details, if you're cycling faster than the server is timing you out. |
|
I still see absolutely no benefit here. Anyone can put anything in. We're no living in a police state that requires people never, ever to even think about withholding information about themselves. About the only "benefit" is to Jamulus Explorer. |
This is really part of the conversation in #1243 itself, as to whether it is an issue that needs to be addressed. The present PR is one way to address it, if that is considered necessary. I'm not aware of any real-life situation that has arisen. But people are still free not to set their profile information, and Jamulus will send empty info. I see no downside to wait until that has happened before starting to send audio.
Obviously, I'm biassed :) But I think some people find the "fetch welcome message" feature in Explorer useful, and would be disappointed if it were removed again. And I think (many) other people would find the flashing up of a transient client, from Explorer doing so, annoying and distracting. I am in both sets, so would hope to change your mind! I also see some value in the approach taken in this PR. In an ideal world, Jamulus would behave like SIP, where a connection is established between client and server, and the audio characteristics negotiated, before either end starts sending any audio at all. |
|
I think the flashing client welcome fetch connect is yet another example of why we should have a server API... rather than a reason to do this. |
Maybe, but let's go for the easy wins first! |
I have now checked the history. This PR should in fact be compatible with all client versions from 3.3.0 onwards (24 Feb 2013), as that is the version which introduced Channel Infos. |
Fixed in 908d356 |
|
OK, if it's as old as 3.3.0, I'll have to back down. It's worth updating the protocol to note that the ChanInfo is now (effectively) required. We should also note it in the release notes. If we're moving in this direction, I'd actually like to be able to drop all or selected protocol messages received from a client whilst they're in particular states - i.e. unidentified, not having OK'd the licence. (And licence first, of course. No point them identifying if they don't agree.) |
I'll add a comment in the code to this effect too.
This is worth exploring, but not before the upcoming release. |
Co-authored-by: Christian Hoffmann <christian@hoffie.info>
Fixes #1243.