Skip to content

Expose api functions for enabling and disabling AV in AV groups#1305

Merged
sudden6 merged 4 commits intoTokTok:masterfrom
zugz:toggleGroupAV
Mar 13, 2019
Merged

Expose api functions for enabling and disabling AV in AV groups#1305
sudden6 merged 4 commits intoTokTok:masterfrom
zugz:toggleGroupAV

Conversation

@zugz
Copy link
Copy Markdown

@zugz zugz commented Jan 25, 2019

see #1303, #1304


This change is Reviewable

Copy link
Copy Markdown

@anthonybilinski anthonybilinski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 1 approvals obtained (waiting on @zugz)


toxav/groupav.c, line 444 at r1 (raw file):

                        audio_data_cb *audio_callback, void *userdata)
{
    if (group_get_type(g_c, groupnumber) != GROUPCHAT_TYPE_AV

didn't this API use to support converting a text groupchat to an AV groupchat? If so, doesn't this check that the groupchat is GROUPCHAT_TYPE_AV break that functionality?

@anthonybilinski
Copy link
Copy Markdown

This is working well from qTox (but note all groups qTox creates are AV groups with our own audio-disablement logic, so my review comment above may still be valid). Thanks for the speedy fix, zugz :D

@zugz zugz force-pushed the toggleGroupAV branch 3 times, most recently from 675c6ff to 9f9a2cd Compare February 3, 2019 15:31
@zugz zugz dismissed anthonybilinski’s stale review February 3, 2019 15:39

No, there's no way in the api to change the type of a group. Since nothing else does, I think we should take the type to in particular dictate the meaning of the group object and the peer objects, which future types may use for different purposes, so then it's important to check it before casting the object as a Group_AV*.

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 3, 2019

Codecov Report

Merging #1305 into master will increase coverage by 1.6%.
The diff coverage is 97.9%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #1305     +/-   ##
========================================
+ Coverage    83.3%   84.9%   +1.6%     
========================================
  Files          82      84      +2     
  Lines       14978   15057     +79     
========================================
+ Hits        12484   12798    +314     
+ Misses       2494    2259    -235
Impacted Files Coverage Δ
auto_tests/run_auto_test.h 100% <100%> (ø) ⬆️
auto_tests/conference_test.c 99.3% <100%> (ø) ⬆️
toxcore/group.c 91.7% <100%> (+12.9%) ⬆️
toxav/toxav_old.c 100% <100%> (ø)
toxav/groupav.c 82% <100%> (ø)
auto_tests/conference_av_test.c 97.1% <97.1%> (ø)
auto_tests/toxav_many_test.c 92.5% <0%> (-4.1%) ⬇️
toxav/msi.c 64.5% <0%> (-4%) ⬇️
toxav/toxav.c 67.6% <0%> (-2.5%) ⬇️
toxcore/friend_connection.c 94.6% <0%> (-2.3%) ⬇️
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0aad180...d14989f. Read the comment docs.

@zugz zugz changed the title WIP: expose api functions for enabling and disabling AV in AV groups expose api functions for enabling and disabling AV in AV groups Feb 3, 2019
@zugz zugz changed the title expose api functions for enabling and disabling AV in AV groups Expose api functions for enabling and disabling AV in AV groups Feb 3, 2019
@sudden6
Copy link
Copy Markdown

sudden6 commented Feb 3, 2019

What's the argumentation behind 5980e8e0c192b7e72c4bfec474946055b84b63d5? Why would we want to forward a packet for which we didn't have a handler? Won't this open up a lot of attack vectors?

Copy link
Copy Markdown

@sudden6 sudden6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 3 of 4 files at r1, 5 of 8 files at r2.
Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @anthonybilinski and @zugz)


auto_tests/conference_av_test.c, line 258 at r2 (raw file):

{
    uint64_t start = state[0].clock;
    do {} while (!(test_audio(toxes, state, disabled, true)

This doesn't look very readable to me, can you maybe put this in a more standard loop structure?


toxav/groupav.c, line 444 at r1 (raw file):

Previously, anthonybilinski (Anthony Bilinski) wrote…

didn't this API use to support converting a text groupchat to an AV groupchat? If so, doesn't this check that the groupchat is GROUPCHAT_TYPE_AV break that functionality?

I second this issue.

@zugz
Copy link
Copy Markdown
Author

zugz commented Feb 4, 2019 via email

@zugz
Copy link
Copy Markdown
Author

zugz commented Feb 4, 2019 via email

@sudden6
Copy link
Copy Markdown

sudden6 commented Feb 5, 2019

Is there something I'm missing here? How can you turn a text group into an AV one?

There might really be a misunderstanding here. I thought this was about making text and AV groups equal, by allowing to switch on/off audio, which would convert the group to AV/text respectively. I guess @anthonybilinski also followed this train of thought.

I think you are implementing just enabling/disabling audio for an AV group, without touching text groups at all?

On a second thought your approach also makes sense, because then if you join a group you already know if there will ever be audio or not.

What I'm now also missing is, that one can join an AV group only as listener/speaker. But maybe that could be implemented on the client side.

The only potential for abuse I see is that it could be used to flood a group with lossy packets, saturating connections without any client-visible sign of the attack. That's already possible in an audio group, because the audio callback doesn't return an error if the packet fails to decode, but it would be new in a text group.

I think there might be other possibilities to abuse forwarding arbitrary data through clients, but your argument about the trusting group members also makes sense, so I'm fine with your solution.

Sorry, wrote this already yesterday, but forgot to send...

@zugz
Copy link
Copy Markdown
Author

zugz commented Feb 5, 2019 via email

@sudden6
Copy link
Copy Markdown

sudden6 commented Feb 5, 2019

I think it would be best left to a separate PR, anyway.

I agree. Just to note though, I would extend the API to just introduce a parameter specifying which direction(s) to enable/disable.

@sudden6
Copy link
Copy Markdown

sudden6 commented Feb 6, 2019

@zugz what about the loop construction?

@zugz
Copy link
Copy Markdown
Author

zugz commented Feb 9, 2019 via email

Copy link
Copy Markdown

@sudden6 sudden6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm_strong:

Reviewed 2 of 8 files at r2, 2 of 2 files at r3.
Reviewable status: :shipit: complete! 1 of 1 approvals obtained (waiting on @anthonybilinski)


auto_tests/conference_av_test.c, line 258 at r2 (raw file):

Previously, sudden6 wrote…

This doesn't look very readable to me, can you maybe put this in a more standard loop structure?

ok, much better now

Copy link
Copy Markdown

@sudden6 sudden6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm_strong:

Reviewed 7 of 7 files at r4.
Reviewable status: :shipit: complete! 1 of 1 approvals obtained (waiting on @anthonybilinski)

@sudden6
Copy link
Copy Markdown

sudden6 commented Mar 9, 2019

@anthonybilinski do you want to add anything here? If not I'll go ahead and merge this.

Copy link
Copy Markdown

@anthonybilinski anthonybilinski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 1 of 1 approvals obtained


toxav/groupav.c, line 444 at r1 (raw file):

Previously, sudden6 wrote…

I second this issue.

you are right about my interpretation, I thought new_group_av was creating a group_av out of a non-av group before. I've got no further issue.

@sudden6 sudden6 merged commit d14989f into TokTok:master Mar 13, 2019
@robinlinden robinlinden added this to the v0.2.10 milestone May 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants